New data model: alpha version

SVN:trunk[484]
This commit is contained in:
Romain Quetiez
2010-06-25 14:44:27 +00:00
parent 50ee5f8194
commit 442161f7bd
6 changed files with 1715 additions and 1379 deletions

View File

@@ -582,7 +582,8 @@ class AttributeString extends AttributeDBField
}
else
{
return preg_match(preg_escape($sRegExp), $value);
$sRegExp = str_replace('/', '\\/', $sRegExp);
return preg_match("/$sRegExp/", $value);
}
}
@@ -860,6 +861,27 @@ class AttributeTemplateText extends AttributeText
public function GetTypeDesc() {return "Multiline template string";}
}
/**
* Specialization of a text: wiki formatting
*
* @package iTopORM
*/
class AttributeWikiText extends AttributeText
{
public function GetTypeDesc() {return "Multiline string with special formatting such as links to objects";}
public function GetAsHTML($value)
{
// [SELECT xxxx.... [label]] => hyperlink to a result list
// {SELECT xxxx.... [label]} => result list displayed inline
// [myclass/nnn [label]] => hyperlink to an object
// {myclass/nnn/attcode} => attribute displayed inline
// etc.
return parent::GetAsHTML($value);
}
}
/**
* Map a enum column to an attribute
*