forked from science-ation/science-ation
- 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:
parent
aa1be324ad
commit
827887a0fd
@ -1 +1 @@
|
||||
92
|
||||
93
|
||||
|
2
db/db.update.93.sql
Normal file
2
db/db.update.93.sql
Normal 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 ;
|
@ -42,9 +42,11 @@ interface TableEditorInterface {
|
||||
//ironforge
|
||||
//$icon_path="/phpscripts/icons/16";
|
||||
//lightbox
|
||||
$icon_path="/icons/16";
|
||||
//$icon_path="/icons/16";
|
||||
//cfdc
|
||||
//$icon_path="/phpscripts/images/16";
|
||||
//sfiab
|
||||
$icon_path="{$config['SFIABDIRECTORY']}/images/16";
|
||||
|
||||
if(!function_exists("i18n"))
|
||||
{
|
||||
@ -405,8 +407,9 @@ class TableEditor
|
||||
{
|
||||
switch($regs[1])
|
||||
{
|
||||
case "text":
|
||||
case "tinytext":
|
||||
$inputmaxlen=255;
|
||||
case "text":
|
||||
$inputtype="textarea";
|
||||
break;
|
||||
case "date":
|
||||
@ -732,7 +735,18 @@ class TableEditor
|
||||
$editdata = $this->defaultLoad();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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\">";
|
||||
foreach($this->editfields AS $f=>$n)
|
||||
{
|
||||
@ -765,10 +779,11 @@ class TableEditor
|
||||
|
||||
break;
|
||||
case "textarea":
|
||||
$maxlen = ($inputmaxlen > 0) ? " onkeypress=\"return do_maxlength(this, $inputmaxlen);\" " : '';
|
||||
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
|
||||
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;
|
||||
case "select":
|
||||
if($this->fieldInputOptions[$f])
|
||||
|
Loading…
Reference in New Issue
Block a user