Permalink
Browse files

* Fixed #1282 - Use S.? instead of S.?? all around Lift

  • Loading branch information...
1 parent 7962c84 commit a771f8b46bbe5c27d05811d4e882d55f704c1dd2 @fmpwizard fmpwizard committed Jul 3, 2012
Showing with 142 additions and 142 deletions.
  1. +2 −2 persistence/ldap/src/main/scala/net/liftweb/ldap/LDAPProtoUser.scala
  2. +1 −1 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedEmail.scala
  3. +6 −6 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPassword.scala
  4. +9 −9 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPostalCode.scala
  5. +1 −1 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedUniqueId.scala
  6. +1 −1 persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala
  7. +2 −2 persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoPasswordField.scala
  8. +2 −2 persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpec.scala
  9. +18 −18 persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala
  10. +68 −68 persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala
  11. +1 −1 persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala
  12. +1 −1 persistence/record/src/main/scala/net/liftweb/record/field/CountryField.scala
  13. +1 −1 persistence/record/src/main/scala/net/liftweb/record/field/EmailField.scala
  14. +1 −1 persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala
  15. +3 −3 persistence/record/src/main/scala/net/liftweb/record/field/PasswordField.scala
  16. +6 −6 persistence/record/src/main/scala/net/liftweb/record/field/PostalCodeField.scala
  17. +2 −2 persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala
  18. +1 −1 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
  19. +2 −2 web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala
  20. +3 −3 web/webkit/src/main/scala/net/liftweb/http/SHtml.scala
  21. +4 −4 web/wizard/src/main/scala/net/liftweb/wizard/Wizard.scala
  22. +7 −7 web/wizard/src/test/scala/net/liftweb/wizard/WizardSpec.scala
@@ -88,7 +88,7 @@ trait MetaLDAPProtoUser[ModelType <: LDAPProtoUser[ModelType]] extends MetaMegaP
<form method="post" action={S.uri}>
<table>
<tr>
- <td colspan="2">{S.??("log.in")}</td>
+ <td colspan="2">{S.?("log.in")}</td>
</tr>
<tr>
<td>Username</td><td><user:name /></td>
@@ -115,7 +115,7 @@ trait MetaLDAPProtoUser[ModelType <: LDAPProtoUser[ModelType]] extends MetaMegaP
Helpers.bind("user", loginXhtml,
"name" -> (JsCmds.FocusOnLoad(<input type="text" name="username"/>)),
"password" -> (<input type="password" name="password"/>),
- "submit" -> (<input type="submit" value={S.??("log.in")}/>))
+ "submit" -> (<input type="submit" value={S.?("log.in")}/>))
}
def ldapLogin(username: String, password: String): Boolean = {
@@ -34,7 +34,7 @@ abstract class MappedEmail[T<:Mapper[T]](owner: T, maxLen: Int) extends MappedSt
override def setFilter = notNull _ :: toLower _ :: trim _ :: super.setFilter
override def validate =
- (if (MappedEmail.emailPattern.matcher(i_is_!).matches) Nil else List(FieldError(this, Text(S.??("invalid.email.address"))))) :::
+ (if (MappedEmail.emailPattern.matcher(i_is_!).matches) Nil else List(FieldError(this, Text(S.?("invalid.email.address"))))) :::
super.validate
}
@@ -57,10 +57,10 @@ extends MappedField[String, T] {
protected def real_i_set_!(value : String) : String = {
password() = value match {
- case "*" | null | MappedPassword.blankPw if (value.length < 3) => {invalidPw = true ; invalidMsg = S.??("password.must.be.set") ; "*"}
+ case "*" | null | MappedPassword.blankPw if (value.length < 3) => {invalidPw = true ; invalidMsg = S.?("password.must.be.set") ; "*"}
case MappedPassword.blankPw => {return "*"}
case _ if (value.length > 4) => {invalidPw = false; hash("{"+value+"} salt={"+salt_i.get+"}")}
- case _ => {invalidPw = true ; invalidMsg = S.??("password.too.short"); "*"}
+ case _ => {invalidPw = true ; invalidMsg = S.?("password.too.short"); "*"}
}
this.dirty_?( true)
"*"
@@ -69,15 +69,15 @@ extends MappedField[String, T] {
def setList(in: List[String]): Boolean =
in match {
case x1 :: x2 :: Nil if x1 == x2 => this.set(x1) ; true
- case _ => invalidPw = true; invalidMsg = S.??("passwords.do.not.match"); false
+ case _ => invalidPw = true; invalidMsg = S.?("passwords.do.not.match"); false
}
override def setFromAny(f: Any): String = {
f match {
case a : Array[String] if (a.length == 2 && a(0) == a(1)) => {this.set(a(0))}
case l : List[String] if (l.length == 2 && l.head == l(1)) => {this.set(l.head)}
- case _ => {invalidPw = true; invalidMsg = S.??("passwords.do.not.match")}
+ case _ => {invalidPw = true; invalidMsg = S.?("passwords.do.not.match")}
}
is
}
@@ -93,7 +93,7 @@ extends MappedField[String, T] {
override def validate : List[FieldError] = {
if (!invalidPw && password.get != "*") Nil
else if (invalidPw) List(FieldError(this, Text(invalidMsg)))
- else List(FieldError(this, Text(S.??("password.must.be.set"))))
+ else List(FieldError(this, Text(S.?("password.must.be.set"))))
}
def real_convertToJDBCFriendly(value: String): Object = hash("{"+value+"} salt={"+salt_i.get+"}")
@@ -124,7 +124,7 @@ extends MappedField[String, T] {
override def _toForm: Box[NodeSeq] = {
S.fmapFunc({s: List[String] => this.setFromAny(s)}){funcName =>
Full(<span>{appendFieldId(<input type={formInputType} name={funcName}
- value={is.toString}/>)}&nbsp;{S.??("repeat")}&nbsp;<input
+ value={is.toString}/>)}&nbsp;{S.?("repeat")}&nbsp;<input
type={formInputType} name={funcName}
value={is.toString}/></span>)
}
@@ -69,7 +69,7 @@ object Countries extends Enumeration(1) {
class I18NCountry extends Val {
override def toString() =
- S.??("country_" + id)
+ S.?("country_" + id)
}
}
@@ -125,8 +125,8 @@ abstract class MappedPostalCode[T <: Mapper[T]](owner: T, country: MappedCountry
private def genericCheck(zip: String): List[FieldError] = {
zip match {
- case null => List(FieldError(this, Text(S.??("invalid.postal.code"))))
- case s if s.length < 3 => List(FieldError(this, Text(S.??("invalid.postal.code"))))
+ case null => List(FieldError(this, Text(S.?("invalid.postal.code"))))
+ case s if s.length < 3 => List(FieldError(this, Text(S.?("invalid.postal.code"))))
case _ => Nil
}
}
@@ -135,22 +135,22 @@ abstract class MappedPostalCode[T <: Mapper[T]](owner: T, country: MappedCountry
override def validations = country.is match {
case Countries.USA => valRegex(REPat.compile("[0-9]{5}(\\-[0-9]{4})?"),
- S.??("invalid.zip.code")) _ :: super.validations
+ S.?("invalid.zip.code")) _ :: super.validations
case Countries.Sweden => valRegex(REPat.compile("[0-9]{3}[ ]?[0-9]{2}"),
- S.??("invalid.postal.code")) _ :: super.validations
+ S.?("invalid.postal.code")) _ :: super.validations
case Countries.Australia => valRegex(REPat.compile("(0?|[1-9])[0-9]{3}"),
- S.??("invalid.postal.code")) _ :: super.validations
+ S.?("invalid.postal.code")) _ :: super.validations
case Countries.Canada => valRegex(REPat.compile("[A-Z][0-9][A-Z][ ][0-9][A-Z][0-9]"),
- S.??("invalid.postal.code")) _ :: super.validations
+ S.?("invalid.postal.code")) _ :: super.validations
case Countries.Germany => valRegex(REPat.compile("[0-9]{5}"),
- S.??("invalid.postal.code")) _ :: super.validations
+ S.?("invalid.postal.code")) _ :: super.validations
case Countries.UK => valRegex(REPat.compile("[A-Z]{1,2}[0-9R][0-9A-Z]?[0-9][ABD-HJLNP-UW-Z]{2}"),
- S.??("invalid.postal.code")) _ :: super.validations
+ S.?("invalid.postal.code")) _ :: super.validations
case _ => genericCheck _ :: super.validations
}
@@ -59,7 +59,7 @@ object Genders extends Enumeration {
class I18NGender(id : Int, name: String) extends Val(id, name) {
override def toString = {
- S.??(name)
+ S.?(name)
}
}
}
@@ -114,7 +114,7 @@ trait ProtoUser[T <: ProtoUser[T]] extends KeyedMapper[Long, T] with UserIdAsStr
protected class MyEmail(obj: T, size: Int) extends MappedEmail(obj, size) {
override def dbIndexed_? = true
- override def validations = valUnique(S.??("unique.email.address")) _ :: super.validations
+ override def validations = valUnique(S.?("unique.email.address")) _ :: super.validations
override def displayName = fieldOwner.emailDisplayName
override val fieldId = Some(Text("txtEmail"))
}
@@ -80,9 +80,9 @@ class MongoPasswordField[OwnerType <: BsonRecord[OwnerType]](rec: OwnerType, min
private def validatePassword(pwd: Password): List[FieldError] = pwd match {
case null | Password("", _) | Password("*", _) | Password(MongoPasswordField.blankPw, _) =>
- Text(S.??("password.must.be.set"))
+ Text(S.?("password.must.be.set"))
case Password(pwd, _) if pwd.length < minLen =>
- Text(S.??("password.too.short"))
+ Text(S.?("password.too.short"))
case _ => Nil
}
@@ -259,7 +259,7 @@ object MongoFieldSpec extends Specification("MongoField Specification") with Mon
val rec = PasswordTestRecord.createRecord
rec.password.setPassword("")
rec.validate must_== (
- FieldError(rec.password, Text(S.??("password.must.be.set"))) ::
+ FieldError(rec.password, Text(S.?("password.must.be.set"))) ::
Nil
)
}
@@ -268,7 +268,7 @@ object MongoFieldSpec extends Specification("MongoField Specification") with Mon
val rec = PasswordTestRecord.createRecord
rec.password.setPassword("ab")
rec.validate must_== (
- FieldError(rec.password, Text(S.??("password.too.short"))) ::
+ FieldError(rec.password, Text(S.?("password.too.short"))) ::
Nil
)
}
@@ -229,7 +229,7 @@ trait Crudify {
*/
val text = new Loc.LinkText(calcLinkText _)
- def calcLinkText(in: TheCrudType): NodeSeq = Text(S.??("crudify.menu.view.displayName", displayName))
+ def calcLinkText(in: TheCrudType): NodeSeq = Text(S.?("crudify.menu.view.displayName", displayName))
/**
* Rewrite the request and emit the type-safe parameter
@@ -264,7 +264,7 @@ trait Crudify {
def name = "Edit "+Prefix
override val snippets: SnippetTest = {
- case ("crud.edit", Full(wp: TheCrudType)) => crudDoForm(wp, S.??("Save"))
+ case ("crud.edit", Full(wp: TheCrudType)) => crudDoForm(wp, S.?("Save"))
}
def defaultValue = Empty
@@ -276,7 +276,7 @@ trait Crudify {
*/
val text = new Loc.LinkText(calcLinkText _)
- def calcLinkText(in: TheCrudType): NodeSeq = Text(S.??("crudify.menu.edit.displayName", displayName))
+ def calcLinkText(in: TheCrudType): NodeSeq = Text(S.?("crudify.menu.edit.displayName", displayName))
/**
* Rewrite the request and emit the type-safe parameter
@@ -307,7 +307,7 @@ trait Crudify {
/**
* The String displayed for menu editing
*/
- def editMenuName = S.??("Edit")+" "+displayName
+ def editMenuName = S.?("Edit")+" "+displayName
/**
* This is the template that's used to render the page after the
@@ -345,7 +345,7 @@ trait Crudify {
</lift:crud.edit>
}
- def editButton = S.??("Save")
+ def editButton = S.?("Save")
/**
* Override this method to change how fields are displayed for delete
@@ -406,7 +406,7 @@ trait Crudify {
*/
val text = new Loc.LinkText(calcLinkText _)
- def calcLinkText(in: TheCrudType): NodeSeq = Text(S.??("crudify.menu.delete.displayName", displayName))
+ def calcLinkText(in: TheCrudType): NodeSeq = Text(S.?("crudify.menu.delete.displayName", displayName))
/**
* Rewrite the request and emit the type-safe parameter
@@ -440,7 +440,7 @@ trait Crudify {
def deleteMenuLocParams: List[Loc.LocParam[TheCrudType]] = Nil
- def deleteMenuName = S.??("Delete")+" "+displayName
+ def deleteMenuName = S.?("Delete")+" "+displayName
/**
* This is the template that's used to render the page after the
@@ -476,10 +476,10 @@ trait Crudify {
</table>
</lift:crud.delete>
- def deleteButton = S.??("Delete")
+ def deleteButton = S.?("Delete")
- def createMenuName = S.??("Create")+" "+displayName
+ def createMenuName = S.?("Create")+" "+displayName
/**
* This is the template that's used to render the page after the
@@ -515,9 +515,9 @@ trait Crudify {
</table>
</lift:crud.create>
- def createButton = S.??("Create")
+ def createButton = S.?("Create")
- def viewMenuName = S.??("View")+" "+displayName
+ def viewMenuName = S.?("View")+" "+displayName
/**
* This is the template that's used to render the page after the
@@ -544,7 +544,7 @@ trait Crudify {
</table>
</lift:crud.view>
- def showAllMenuName = S.??("List")+" "+displayName
+ def showAllMenuName = S.?("List")+" "+displayName
/**
* This is the template that's used to render the page after the
@@ -574,9 +574,9 @@ trait Crudify {
<crud:row>
<tr>
<crud:row_item><td><crud:value/></td></crud:row_item>
- <td><a crud:view_href="">{S.??("View")}</a></td>
- <td><a crud:edit_href="">{S.??("Edit")}</a></td>
- <td><a crud:delete_href="">{S.??("Delete")}</a></td>
+ <td><a crud:view_href="">{S.?("View")}</a></td>
+ <td><a crud:edit_href="">{S.?("Edit")}</a></td>
+ <td><a crud:delete_href="">{S.?("Delete")}</a></td>
</tr>
</crud:row>
</tbody>
@@ -589,8 +589,8 @@ trait Crudify {
</table>
</lift:crud.all>
- def nextWord = S.??("Next")
- def previousWord = S.??("Previous")
+ def nextWord = S.?("Next")
+ def previousWord = S.?("Previous")
lazy val listPath = Prefix ::: List(ListItems)
@@ -721,7 +721,7 @@ trait Crudify {
lazy val locSnippets = new DispatchLocSnippets {
val dispatch: PartialFunction[String, NodeSeq => NodeSeq] = {
case "crud.all" => doCrudAll
- case "crud.create" => crudDoForm(create, S.??("Created"))
+ case "crud.create" => crudDoForm(create, S.?("Created"))
}
}
Oops, something went wrong.

0 comments on commit a771f8b

Please sign in to comment.