- Change the volunteer position description/meet_place colums to text from

tinytext.
- Change the icon_path to somethign SFIAB will like better in the tableeditor
  (was wondering why I had no icons in the tableeditor)
- Add a crude maxlength support for text areas
This commit is contained in:
dave 2007-12-29 19:43:56 +00:00
parent aa1be324ad
commit 827887a0fd
3 changed files with 23 additions and 6 deletions

View File

@ -1 +1 @@
92 93

2
db/db.update.93.sql Normal file
View File

@ -0,0 +1,2 @@
ALTER TABLE `volunteer_positions` CHANGE `desc` `desc` TEXT NOT NULL ;
ALTER TABLE `volunteer_positions` CHANGE `meet_place` `meet_place` TEXT NOT NULL ;

View File

@ -42,9 +42,11 @@ interface TableEditorInterface {
//ironforge //ironforge
//$icon_path="/phpscripts/icons/16"; //$icon_path="/phpscripts/icons/16";
//lightbox //lightbox
$icon_path="/icons/16"; //$icon_path="/icons/16";
//cfdc //cfdc
//$icon_path="/phpscripts/images/16"; //$icon_path="/phpscripts/images/16";
//sfiab
$icon_path="{$config['SFIABDIRECTORY']}/images/16";
if(!function_exists("i18n")) if(!function_exists("i18n"))
{ {
@ -405,8 +407,9 @@ class TableEditor
{ {
switch($regs[1]) switch($regs[1])
{ {
case "text":
case "tinytext": case "tinytext":
$inputmaxlen=255;
case "text":
$inputtype="textarea"; $inputtype="textarea";
break; break;
case "date": case "date":
@ -733,6 +736,17 @@ class TableEditor
} }
} }
echo "<script language=\"javascript\" type=\"text/javascript\">
<!--
function do_maxlength(obj, maxlength)
{
if(obj.value.length > maxlength) {
obj.value = obj.value.substr(0, maxlength);
}
}
-->
</script>";
echo "<table class=\"tableedit\">"; echo "<table class=\"tableedit\">";
foreach($this->editfields AS $f=>$n) foreach($this->editfields AS $f=>$n)
{ {
@ -765,10 +779,11 @@ class TableEditor
break; break;
case "textarea": case "textarea":
$maxlen = ($inputmaxlen > 0) ? " onkeypress=\"return do_maxlength(this, $inputmaxlen);\" " : '';
if($this->fieldInputOptions[$f]) if($this->fieldInputOptions[$f])
echo "<textarea id=\"$f\" name=\"$f\" ".$this->fieldInputOptions[$f].">".htmlspecialchars($editdata[$f])."</textarea>"; echo "<textarea id=\"$f\" name=\"$f\" $maxlen".$this->fieldInputOptions[$f].">".htmlspecialchars($editdata[$f])."</textarea>";
else else
echo "<textarea id=\"$f\" name=\"$f\" rows=\"5\" cols=\"50\">".htmlspecialchars($editdata[$f])."</textarea>"; echo "<textarea id=\"$f\" name=\"$f\" $maxlen rows=\"5\" cols=\"50\">".htmlspecialchars($editdata[$f])."</textarea>";
break; break;
case "select": case "select":
if($this->fieldInputOptions[$f]) if($this->fieldInputOptions[$f])