Index: trunk/globals.php =================================================================== diff -u -N -r3330 -r3534 --- trunk/globals.php (.../globals.php) (revision 3330) +++ trunk/globals.php (.../globals.php) (revision 3534) @@ -2051,5 +2051,14 @@ return defined($const_name) && constant($const_name); } } + + function &recallObject($var_name, $class_name) + { + if (!isset($GLOBALS[$var_name]) || !is_object($GLOBALS[$var_name])) + { + $GLOBALS[$var_name] = new $class_name(); + } + return $GLOBALS[$var_name]; + } ?> Index: trunk/kernel/include/language.php =================================================================== diff -u -N -r3330 -r3534 --- trunk/kernel/include/language.php (.../language.php) (revision 3330) +++ trunk/kernel/include/language.php (.../language.php) (revision 3534) @@ -66,14 +66,14 @@ } - function &AddPhrase($Phrase,$LangId,$Translation,$Type) + function &AddPhrase($Phrase,$LangId,$Translation,$Type, $Module = 'In-Portal') { $tmpphrase = $this->GetPhrase($Phrase, $LangId); if (!$tmpphrase) { $p = new clsPhrase(); $p->tablename = $this->SourceTable; - $p->Set(array("Phrase","LanguageId","Translation","PhraseType"), - array($Phrase,$LangId,$Translation,$Type)); + $p->Set(array("Phrase","LanguageId","Translation","PhraseType", 'Module', 'LastChanged', 'LastChangeIP'), + array($Phrase,$LangId,$Translation,$Type, $Module, time(), $_SERVER['REMOTE_ADDR'] )); $p->Dirty(); $p->Create(); return $p; @@ -90,11 +90,11 @@ } } - function &EditPhrase($id,$Phrase,$LangId,$Translation,$Type) + function &EditPhrase($id,$Phrase,$LangId,$Translation,$Type, $Module = 'In-Portal') { $p = $this->GetItem($id); - $p->Set(array("Phrase","LanguageId","Translation","PhraseType"), - array($Phrase,$LangId,$Translation,$Type)); + $p->Set(array("Phrase","LanguageId","Translation","PhraseType", 'Module', 'LastChanged', 'LastChangeIP'), + array($Phrase,$LangId,$Translation,$Type, $Module, time(), $_SERVER['REMOTE_ADDR'] )); $p->Dirty(); $p->Update(); return $p; Index: trunk/kernel/include/searchconfig.php =================================================================== diff -u -N -r1566 -r3534 --- trunk/kernel/include/searchconfig.php (.../searchconfig.php) (revision 1566) +++ trunk/kernel/include/searchconfig.php (.../searchconfig.php) (revision 3534) @@ -269,7 +269,7 @@ function GetNextDisplayOrder($mod) { $ret = 0; - $sql = "SELECT max(DisplayOrder) as do FROM ".$this->SourceTable." WHERE ModuleName='$mod'"; + $sql = "SELECT MAX(DisplayOrder) AS do FROM ".$this->SourceTable." WHERE ModuleName = '$mod'"; $rs = $this->adodbConnection->Execute($sql); if($rs && !$rs->EOF) $ret = $rs->fields["do"]+1; @@ -381,9 +381,9 @@ return $f; } - function &AddSearchField($Table,$FieldName,$Module,$Simple,$Adv,$Description,$DisplayName,$ConfigHeader,$DisplayOrder=0, - $Priority=0,$FieldType="text",$JoinClause=NULL,$IsWhere=NULL,$IsNotWhere=NULL,$ContainsWhere=NULL,$NotContainsWhere=NULL,$CustomId=0, $ForeignField = NULL) + function &AddSearchField($Table,$FieldName,$Module,$Simple,$Adv,$Description,$DisplayName,$ConfigHeader,$DisplayOrder=0,$Priority=0,$FieldType="text",$JoinClause=NULL,$IsWhere=NULL,$IsNotWhere=NULL,$ContainsWhere=NULL,$NotContainsWhere=NULL,$CustomId=0, $ForeignField = NULL) { + $f = new clsSearchConfig(); if($DisplayOrder==0) $DisplayOrder = $this->GetNextDisplayOrder($Module); Index: trunk/admin/config/addcustomfield.php =================================================================== diff -u -N -r2853 -r3534 --- trunk/admin/config/addcustomfield.php (.../addcustomfield.php) (revision 2853) +++ trunk/admin/config/addcustomfield.php (.../addcustomfield.php) (revision 3534) @@ -157,12 +157,14 @@
"; print_r($s); echo ""; - if(is_object($s)) - { - $s->Delete(); - } - } + $sql = 'DELETE FROM '.$objSearchConfig->SourceTable.' WHERE CustomFieldId = '.$FieldId; + $this->adodbConnection->Execute($sql); + + $phrase_name = 'lu_fieldcustom__'.strtolower($f->Get('FieldName')); + $sql = 'DELETE FROM '.GetTablePrefix().'Phrase WHERE Phrase = '.$this->adodbConnection->qstr($phrase_name); + $this->adodbConnection->Execute($sql); } $f->Delete(); }