FEATURE made sapphire i18n-capable

FEATURE a little bit of german translation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43842 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-10-25 02:47:45 +00:00
parent 06c2bd9b10
commit 393caf4287
51 changed files with 1011 additions and 390 deletions

View File

@ -48,7 +48,7 @@ class ErrorPage extends Page {
"Root.Content.Main", "Root.Content.Main",
new DropdownField( new DropdownField(
"ErrorCode", "ErrorCode",
"Error code", _t('ErrorPage.CODE', "Error code"),
array( array(
404 => "404 - Page not found", 404 => "404 - Page not found",
500 => "500 - Server error" 500 => "500 - Server error"

View File

@ -18,7 +18,9 @@ class GhostPage extends SiteTree implements HiddenClass {
if($this->getField('LinkedPageID')) { if($this->getField('LinkedPageID')) {
return $this->LinkedPage()->getCMSFields($val); return $this->LinkedPage()->getCMSFields($val);
} else { } else {
return new FieldSet(new LabelField("This ghost page has no linked page.")); return new FieldSet(
new LabelField(_t('GhostPage.NOLINKED', "This ghost page has no linked page."))
);
} }
} }

View File

@ -507,34 +507,43 @@ class Image_Uploader extends Controller {
*/ */
function EditImageForm() { function EditImageForm() {
$isImage = $this->IsImage(); $isImage = $this->IsImage();
$type = $isImage ? "Image" : "File"; $type = $isImage ? _t('Controller.IMAGE', "Image") : _t('Controller.FILE', "File");
if($this->Image()->ID) { if($this->Image()->ID) {
$title = "Replace " . $type; $title = sprintf(
$fromYourPC = "With one from your computer"; _t('ImageUploader.REPLACE', "Replace %s", PR_MEDIUM, 'Replace file/image'),
$fromTheDB = "With one from the file store"; $type
);
$fromYourPC = _t('ImageUploader.ONEFROMCOMPUTER', "With one from your computer");
$fromTheDB = _t('ImageUplaoder.ONEFROMFILESTORE', "With one from the file store");
} else { } else {
$title = "Attach ". $type; $title = sprintf(
$fromYourPC = "From your computer"; _t('ImageUploader.ATTACH', "Attach %s", PR_MEDIUM, 'Attach image/file'),
$fromTheDB = "From the file store"; $type
);
$fromYourPC = _t('ImageUploader.FROMCOMPUTER', "From your computer");
$fromTheDB = _t('ImageUploader.FROMFILESTORE', "From the file store");
} }
return new Form($this, 'EditImageForm', new FieldSet( return new Form(
new HiddenField("Class", null, $this->urlParams['Class']), $this,
new HiddenField("ID", null, $this->urlParams['ID']), 'EditImageForm',
new HiddenField("Field", null, $this->urlParams['Field']), new FieldSet(
new HeaderField($title), new HiddenField("Class", null, $this->urlParams['Class']),
new SelectionGroup("ImageSource", array( new HiddenField("ID", null, $this->urlParams['ID']),
"new//$fromYourPC" => new FieldGroup("", new HiddenField("Field", null, $this->urlParams['Field']),
new FileField("Upload","") new HeaderField($title),
), new SelectionGroup("ImageSource", array(
"existing//$fromTheDB" => new FieldGroup("", "new//$fromYourPC" => new FieldGroup("",
new TreeDropdownField("ExistingFile", "","File") new FileField("Upload","")
) ),
)) "existing//$fromTheDB" => new FieldGroup("",
), new TreeDropdownField("ExistingFile", "","File")
)
new FieldSet( ))
new FormAction("save",$title) ),
)); new FieldSet(
new FormAction("save",$title)
)
);
} }
/** /**
@ -543,13 +552,19 @@ class Image_Uploader extends Controller {
*/ */
function EditImageSimpleForm() { function EditImageSimpleForm() {
$isImage = $this->IsImage(); $isImage = $this->IsImage();
$type = $isImage ? "Image" : "File"; $type = $isImage ? _t('Controller.IMAGE') : _t('Controller.FILE');
if($this->Image()->ID) { if($this->Image()->ID) {
$title = "Replace " . $type; $title = sprintf(
$fromYourPC = "With one from your computer"; _t('ImageUploader.REPLACE'),
$type
);
$fromYourPC = _t('ImageUploader.ONEFROMCOMPUTER');
} else { } else {
$title = "Attach". $type; $title = sprintf(
$fromTheDB = "From the file store"; _t('ImageUploader.ATTACH'),
$type
);
$fromTheDB = _t('ImageUploader.ONEFROMFILESTORE');
} }
return new Form($this, 'EditImageSimpleForm', new FieldSet( return new Form($this, 'EditImageSimpleForm', new FieldSet(
@ -570,15 +585,35 @@ class Image_Uploader extends Controller {
function DeleteImageForm() { function DeleteImageForm() {
if($this->Image()->ID) { if($this->Image()->ID) {
$isImage = $this->IsImage(); $isImage = $this->IsImage();
$type = $isImage ? "Image" : "File"; $type = $isImage ? _t('Controller.IMAGE') : _t('Controller.FILE');
$title = "Delete " . $type; $title = sprintf(
return new Form($this,'DeleteImageForm', new FieldSet( _t('ImageUploader.DELETE', 'Delete %s', PR_MEDIUM, 'Delete file/image'),
new HiddenField("ID", null, $this->urlParams['ID']), $type
new HeaderField($title), );
new LabelField("Click the button below to remove this $type.") return new Form(
$this,
'DeleteImageForm',
new FieldSet(
new HiddenField("ID", null, $this->urlParams['ID']),
new HeaderField($title),
new LabelField(
sprintf(
_t(
'ImageUploader.CLICKREMOVE',
"Click the button below to remove this %s.",
PR_MEDIUM,
'... this image/file'
),
$type
)
)
), ),
new FieldSet( new FieldSet(
new ConfirmedFormAction("delete",$title, "Do you really want to remove this $type?") new ConfirmedFormAction(
"delete",
$title,
sprintf(_t('ImageUploader.REALLYDELETE', "Do you really want to remove this %s?"), $type)
)
) )
); );
} }

View File

@ -46,47 +46,69 @@ class RedirectorPage extends Page {
function getCMSFields() { function getCMSFields() {
Requirements::javascript("sapphire/javascript/RedirectorPage.js"); Requirements::javascript("sapphire/javascript/RedirectorPage.js");
return new FieldSet( $fields = new FieldSet(
new TabSet("Root", new TabSet("Root",
new Tab("Content", $tabContent = new Tab("Content",
new TextField("Title", "Page name"), new TextField("Title", _t('SiteTree.PAGETITLE')),
new TextField("MenuTitle", "Navigation label"), new TextField("MenuTitle", _t('SiteTree.MENUTITLE')),
new FieldGroup("URL", new FieldGroup(_t('SiteTree.URL'),
new LabelField("http://www.yoursite.com/"), new LabelField("http://www.yoursite.com/"),
new TextField("URLSegment",""), new TextField("URLSegment",""),
new LabelField("/") new LabelField("/")
), ),
new HeaderField("This page will redirect users to another page"), new HeaderField(_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
new OptionsetField("RedirectionType", "Redirect to", array( new OptionsetField(
"Internal" => "A page on your website", "RedirectionType",
"External" => "Another website", _t('RedirectorPage.REDIRECTTO', "Redirect to"),
), "Internal"), array(
new TreeDropdownField("LinkToID", "Page on your website", "SiteTree"), "Internal" => _t('RedirectorPage.REDIRECTTOPAGE', "A page on your website"),
new TextField("ExternalURL", "Other websiteURL"), "External" => _t('RedirectorPage.REDIRECTTOEXTERNAL', "Another website"),
new TextareaField("MetaDescription", "Meta Description") ),
"Internal"
),
new TreeDropdownField(
"LinkToID",
_t('RedirectorPage.YOURPAGE', "Page on your website"),
"SiteTree"
),
new TextField("ExternalURL", _t('RedirectorPage.OTHERURL', "Other website URL")),
new TextareaField("MetaDescription", _t('SiteTree.METADESC'))
), ),
new Tab("Behaviour", $tabBehaviour = new Tab("Behaviour",
new DropdownField("ClassName", "Page type", $this->getClassDropdown()), new DropdownField("ClassName", _t('SiteTree.PAGETYPE'), $this->getClassDropdown()),
new CheckboxField("ShowInMenus", "Show in menus?"), new CheckboxField("ShowInMenus", _t('SiteTree.SHOWINMENUS')),
new CheckboxField("ShowInSearch", "Show in search?") new CheckboxField("ShowInSearch", _t('SiteTree.SHOWINSEARCH'))
) )
) )
); );
$tabContent->setTitle(_t('SiteTree.TABCONTENT'));
$tabBehaviour->setTitle(_t('SiteTree.TABBEHAVIOUR'));
return $fields;
} }
} }
class RedirectorPage_Controller extends Page_Controller { class RedirectorPage_Controller extends Page_Controller {
function init() { function init() {
if($this->RedirectionType == 'External') { if($this->RedirectionType == 'External') {
if($this->ExternalURL) Director::redirect($this->ExternalURL); if($this->ExternalURL) {
else echo "<p>A redirector page has been set up without anywhere to redirect to.</p>"; Director::redirect($this->ExternalURL);
} else {
echo "<p>" .
_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
"</p>";
}
} else { } else {
$linkTo = DataObject::get_by_id("SiteTree", $this->LinkToID); $linkTo = DataObject::get_by_id("SiteTree", $this->LinkToID);
if($linkTo) Director::redirect($linkTo->Link()); if($linkTo) {
else echo "<p>A redirector page has been set up without anywhere to redirect to.</p>"; Director::redirect($linkTo->Link());
} else {
echo "<p>" . _t('RedirectorPage.HASBEENSETUP') . "</p>";
}
} }
parent::init(); parent::init();
} }
} }
?> ?>

View File

@ -826,10 +826,10 @@ class SiteTree extends DataObject {
$urlSegment = $page->URLSegment; $urlSegment = $page->URLSegment;
$page->write(); $page->write();
if($urlSegment != $page->URLSegment) { if($urlSegment != $page->URLSegment) {
echo " changed $urlSegment -> $page->URLSegment"; echo sprintf(_t('SiteTree.LINKSCHANGEDTO', " changed %s -> %s"), $urlSegment, $page->URLSegment);
} }
else { else {
echo " $urlSegment is already unique"; echo sprintf(_t('SiteTree.LINKSALREADYUNIQUE', " %s is already unique"), $urlSegment);
} }
die(); die();
} }
@ -846,10 +846,10 @@ class SiteTree extends DataObject {
$newURLSegment = $urlSegment . '-' . $page['ID']; $newURLSegment = $urlSegment . '-' . $page['ID'];
DB::query("UPDATE SiteTree SET URLSegment = '$newURLSegment' WHERE ID = $page[ID]"); DB::query("UPDATE SiteTree SET URLSegment = '$newURLSegment' WHERE ID = $page[ID]");
if($urlSegment != $newURLSegment) { if($urlSegment != $newURLSegment) {
echo " changed $urlSegment -> $newURLSegment"; echo sprintf(_t('SiteTree.LINKSCHANGEDTO'), $urlSegment, $newURLSegment);
} }
else { else {
echo " $urlSegment is already unique"; echo sprintf(_t('SiteTree.LINKSALREADYUNIQUE'), $urlSegment);
} }
} }
echo "<p>done"; echo "<p>done";
@ -917,13 +917,14 @@ class SiteTree extends DataObject {
$backlinks[] = "<li><a class=\"cmsEditlink\" href=\"admin/show/$link->ID\">" . $backlinks[] = "<li><a class=\"cmsEditlink\" href=\"admin/show/$link->ID\">" .
$link->Breadcrumbs(null,true) . "</a></li>"; $link->Breadcrumbs(null,true) . "</a></li>";
} }
$backlinks = "<div style=\"clear:left\">The following pages link to this page:<ul>" . $backlinks = "<div style=\"clear:left\">
implode("",$backlinks) . "</ul></div>"; " . _t('SiteTree.PAGESLINKING', 'The following pages link to this page:') .
"<ul>" . implode("",$backlinks) . "</ul></div>";
} }
} }
if(!isset($backlinks)) { if(!isset($backlinks)) {
$backlinks = "<p>This page hasn't been linked to from any pages.</p>"; $backlinks = "<p>" . _t('SiteTree.NOBACKLINKS', 'This page hasn\'t been linked to from any pages.') . "</p>";
} }
@ -941,7 +942,9 @@ class SiteTree extends DataObject {
if($parentPage->ID) { if($parentPage->ID) {
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>"; $parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>";
} else { } else {
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">Site Content (Top Level)</a>"; $parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">" .
_t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') .
"</a>";
} }
} }
@ -953,11 +956,14 @@ class SiteTree extends DataObject {
. $parentList; . $parentList;
} }
$statusMessage[] = "This content also appears on the virtual pages in the $parentList sections."; $statusMessage[] = sprintf(
_t('SiteTree.APPEARSVIRTUALPAGES', "This content also appears on the virtual pages in the %s sections."),
$parentList
);
} }
if($this->HasBrokenLink || $this->HasBrokenFile) { if($this->HasBrokenLink || $this->HasBrokenFile) {
$statusMessage[] = "This page has broken links."; $statusMessage[] = _t('SiteTree.HASBROKENLINKS', "This page has broken links.");
} }
$message = "STATUS: $this->Status<br />"; $message = "STATUS: $this->Status<br />";
@ -969,29 +975,29 @@ class SiteTree extends DataObject {
// Lay out the fields // Lay out the fields
$fields = new FieldSet( $fields = new FieldSet(
new TabSet("Root", new TabSet("Root",
new TabSet("Content", $tabContent = new TabSet('Content',
new Tab("Main", $tabMain = new Tab('Main',
new TextField("Title", "Page name"), new TextField("Title", _t('SiteTree.PAGETITLE', "Page name")),
/*new UniqueTextField("Title", /*new UniqueTextField("Title",
"Title", "Title",
"SiteTree", "SiteTree",
"Another page is using that name. Page names should be unique.", "Another page is using that name. Page names should be unique.",
"Page Name" "Page Name"
),*/ ),*/
new TextField("MenuTitle", "Navigation label"), new TextField("MenuTitle", _t('SiteTree.MENUTITLE', "Navigation label")),
new HtmlEditorField("Content","Content") new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", PR_MEDIUM, 'HTML editor title'))
), ),
new Tab("Meta-data", $tabMeta = new Tab('Meta-data',
new FieldGroup("URL", new FieldGroup(_t('SiteTree.URL', "URL"),
new LabelField("http://www.yoursite.com/"), new LabelField("http://www.yoursite.com/"),
//new TextField("URLSegment",""), //new TextField("URLSegment",""),
new UniqueRestrictedTextField("URLSegment", new UniqueRestrictedTextField("URLSegment",
"URLSegment", "URLSegment",
"SiteTree", "SiteTree",
"Another page is using that URL. URL must be unique for each page", _t('SiteTree.VALIDATIONURLSEGMENT1', "Another page is using that URL. URL must be unique for each page"),
"[^A-Za-z0-9-]+", "[^A-Za-z0-9-]+",
"-", "-",
"URLs can only be made up of letters, digits and hyphens.", _t('SiteTree.VALIDATIONURLSEGMENT2', "URLs can only be made up of letters, digits and hyphens."),
"", "",
"", "",
"", "",
@ -999,48 +1005,91 @@ class SiteTree extends DataObject {
), ),
new LabelField("/") new LabelField("/")
), ),
new HeaderField("Search Engine Meta-tags"), new HeaderField(_t('SiteTree.METAHEADER', "Search Engine Meta-tags")),
new TextField("MetaTitle", "Title"), new TextField("MetaTitle", _t('SiteTree.METATITLE', "Title")),
new TextareaField("MetaDescription", "Description"), new TextareaField("MetaDescription", _t('SiteTree.METADESC', "Description")),
new TextareaField("MetaKeywords", "Keywords"), new TextareaField("MetaKeywords", _t('SiteTree.METAKEYWORDS', "Keywords")),
new ToggleCompositeField("Advanced Options...",array( new ToggleCompositeField(_t('SiteTree.METAADVANCEDHEADER', "Advanced Options..."),
new TextareaField("ExtraMeta","Custom Meta Tags"), array(
new LiteralField("", "<p>Manually specify a Priority for this page: (valid values are from 0 to 1, a zero will remove this page from the index)</p>"), new TextareaField("ExtraMeta",_t('SiteTree.METAEXTRA', "Custom Meta Tags")),
new NumericField("Priority","Page Priority")), new LiteralField(
"",
"<p>" .
_t(
'SiteTree.METANOTEPRIORITY',
"Manually specify a Priority for this page:
(valid values are from 0 to 1, a zero will remove this page from the index)"
) .
"</p>"
),
new NumericField("Priority", _t('SiteTree.METAPAGEPRIO', "Page Priority"))
),
true true
) )
) )
), ),
new Tab("Behaviour", $tabBehaviour = new Tab('Behaviour',
new DropdownField("ClassName", "Page type", $this->getClassDropdown()), new DropdownField(
new CheckboxField("ShowInMenus", "Show in menus?"), "ClassName",
new CheckboxField("ShowInSearch", "Show in search?"), _t('SiteTree.PAGETYPE', "Page type", PR_MEDIUM, 'Classname of a page object'),
$this->getClassDropdown()
),
new CheckboxField("ShowInMenus", _t('SiteTree.SHOWINMENUS', "Show in menus?")),
new CheckboxField("ShowInSearch", _t('SiteTree.SHOWINSEARCH', "Show in search?")),
/*, new TreeMultiselectField("MultipleParents", "Page appears within", "SiteTree")*/ /*, new TreeMultiselectField("MultipleParents", "Page appears within", "SiteTree")*/
new CheckboxField("ProvideComments", "Allow comments on this page?"), new CheckboxField("ProvideComments", _t('SiteTree.ALLOWCOMMENTS', "Allow comments on this page?")),
new LiteralField("", "<p>Use this page as the 'home page' for the following domains: (separate multiple domains with commas)</p>"), new LiteralField(
new TextField("HomepageForDomain", "Domain(s)") "",
"<p>" .
_t('SiteTree.NOTEUSEASHOMEPAGE',
"Use this page as the 'home page' for the following domains:
(separate multiple domains with commas)") .
"</p>"
),
new TextField(
"HomepageForDomain",
_t('SiteTree.HOMEPAGEFORDOMAIN', "Domain(s)", PR_MEDIUM, 'Listing domains that should be used as homepage')
)
), ),
new TabSet("Reports", $tabReports = new TabSet('Reports',
new Tab("BackLinks", $tabBacklinks =new Tab('Backlinks',
new LiteralField("Backlinks", $backlinks) new LiteralField("Backlinks", $backlinks)
) )
), ),
new Tab("Access", $tabAccess = new Tab('Access',
new HeaderField("Who can view this page on my site?", 2), new HeaderField(_t('SiteTree.ACCESSHEADER', "Who can view this page on my site?"), 2),
new OptionsetField("Viewers", "", new OptionsetField(
array("Anyone" => "Anyone", "Viewers",
"LoggedInUsers" => "Logged-in users", "",
"OnlyTheseUsers" => "Only these people (choose from list)")), array(
new DropdownField("ViewersGroup", "Group", Group::map()), "Anyone" => _t('SiteTree.ACCESSANYONE', "Anyone"),
new HeaderField("Who can edit this inside the CMS?", 2), "LoggedInUsers" => _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users"),
new OptionsetField("Editors", "", "OnlyTheseUsers" => _t('SiteTree.ACCESSONLYTHESE', "Only these people (choose from list)")
array("LoggedInUsers" => "Anyone who can log-in to the CMS", )
"OnlyTheseUsers" => "Only these people (choose from list)")), ),
new DropdownField("EditorsGroup", "Group", Group::map()) new DropdownField("ViewersGroup", _t('SiteTree.GROUP', "Group"), Group::map()),
new HeaderField(_t('SiteTree.EDITHEADER', "Who can edit this inside the CMS?"), 2),
new OptionsetField(
"Editors",
"",
array(
"LoggedInUsers" => _t('SiteTree.EDITANYONE', "Anyone who can log-in to the CMS"),
"OnlyTheseUsers" => _t('SiteTree.EDITONLYTHESE', "Only these people (choose from list)")
)
),
new DropdownField("EditorsGroup", _t('SiteTree.GROUP'), Group::map())
) )
), ),
new NamedLabelField("Status", $message, "pageStatusMessage", true) new NamedLabelField("Status", $message, "pageStatusMessage", true)
); );
$tabContent->setTitle(_t('SiteTree.TABCONTENT', "Content"));
$tabMain->setTitle(_t('SiteTree.TABMAIN', "Main"));
$tabMeta->setTitle(_t('SiteTree.TABMETA', "Meta-data"));
$tabBehaviour->setTitle(_t('SiteTree.TABBEHAVIOUR', "Behaviour"));
$tabReports->setTitle(_t('SiteTree.TABREPORTS', "Reports"));
$tabAccess->setTitle(_t('SiteTree.TABACCESS', "Access"));
$tabBacklinks->setTitle(_t('SiteTree.TABBACKLINKS', "BackLinks"));
foreach(self::$cms_additions as $extension) foreach(self::$cms_additions as $extension)
{ {
@ -1062,8 +1111,8 @@ class SiteTree extends DataObject {
$actions = array(); $actions = array();
if($this->isPublished() && $this->canPublish()) { if($this->isPublished() && $this->canPublish()) {
$unpublish = FormAction::create('unpublish', 'Unpublish', 'delete'); $unpublish = FormAction::create('unpublish', _t('SiteTree.BUTTONUNPUBLISH', 'Unpublish'), 'delete');
$unpublish->describe("Remove this page from the published site"); $unpublish->describe(_t('SiteTree.BUTTONUNPUBLISHDESC', "Remove this page from the published site"));
$unpublish->addExtraClass('delete'); $unpublish->addExtraClass('delete');
$actions[] = $unpublish; $actions[] = $unpublish;
} }
@ -1071,15 +1120,15 @@ class SiteTree extends DataObject {
if($this->stagesDiffer('Stage', 'Live')) { if($this->stagesDiffer('Stage', 'Live')) {
if($this->isPublished() && $this->canEdit()) { if($this->isPublished() && $this->canEdit()) {
$rollback = FormAction::create('rollback', 'Cancel draft changes', 'delete'); $rollback = FormAction::create('rollback', _t('SiteTree.BUTTONCANCELDRAFT', 'Cancel draft changes'), 'delete');
$rollback->describe("Delete your draft and revert to the currently published page"); $rollback->describe(_t('SiteTree.BUTTONCANCELDRAFTDESC', "Delete your draft and revert to the currently published page"));
$rollback->addExtraClass('delete'); $rollback->addExtraClass('delete');
$actions[] = $rollback; $actions[] = $rollback;
} }
} }
if($this->canPublish()) if($this->canPublish())
$actions[] = new FormAction('publish', 'Save & Publish'); $actions[] = new FormAction('publish', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & Publish'));
return new DataObjectSet($actions); return new DataObjectSet($actions);
} }
@ -1281,9 +1330,12 @@ class SiteTree extends DataObject {
} }
$tag = $tag =
($this->DeletedFromStage ? "del title=\"Removed from draft site\"" : ($this->DeletedFromStage ?
($this->AddedToStage ? "ins title=\"Added to draft site\"" : "del title=\"" . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "\"" :
($this->ModifiedOnStage ? "span title=\"Modified on draft site\" class=\"modified\"" : ""))); ($this->AddedToStage ?
"ins title=\"" . _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "\"" :
($this->ModifiedOnStage ?
"span title=\"" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "\" class=\"modified\"" : "")));
if($tag) { if($tag) {
return "<$tag>" . $this->Title . "</" . strtok($tag,' ') . ">"; return "<$tag>" . $this->Title . "</" . strtok($tag,' ') . ">";

View File

@ -6,7 +6,7 @@
* Note: This Only duplicates $db fields and not the $has_one etc.. * Note: This Only duplicates $db fields and not the $has_one etc..
*/ */
class VirtualPage extends Page { class VirtualPage extends Page {
static $add_action = "a 'virtual' page that uses another page's content"; static $add_action = "Virtual page (another page's content)";
static $icon = array("cms/images/treeicons/page-shortcut-gold","file"); static $icon = array("cms/images/treeicons/page-shortcut-gold","file");
@ -57,7 +57,11 @@ class VirtualPage extends Page {
$fields = parent::getCMSFields($cms); $fields = parent::getCMSFields($cms);
// Setup the linking to the original page. // Setup the linking to the original page.
$copyContentFromField = new TreeDropdownField("CopyContentFromID", "Choose a page to link to", "SiteTree"); $copyContentFromField = new TreeDropdownField(
"CopyContentFromID",
_t('VirtualPage.CHOOSE', "Choose a page to link to"),
"SiteTree"
);
$copyContentFromField->setFilterFunction(create_function('$item', 'return $item->ClassName != "VirtualPage";')); $copyContentFromField->setFilterFunction(create_function('$item', 'return $item->ClassName != "VirtualPage";'));
// Setup virtual fields // Setup virtual fields
@ -70,12 +74,16 @@ class VirtualPage extends Page {
} }
// Add fields to the tab // Add fields to the tab
$fields->addFieldToTab("Root.Content.Main", new HeaderField("This is a virtual page"), "Title"); $fields->addFieldToTab("Root.Content.Main",
new HeaderField(_t('VirtualPage.HEADER', "This is a virtual page")),
"Title"
);
$fields->addFieldToTab("Root.Content.Main", $copyContentFromField, "Title"); $fields->addFieldToTab("Root.Content.Main", $copyContentFromField, "Title");
// Create links back to the original object in the CMS // Create links back to the original object in the CMS
if($this->CopyContentFromID) { if($this->CopyContentFromID) {
$linkToContent = "<a class=\"cmsEditlink\" href=\"admin/show/$this->CopyContentFromID\">click here to edit the content</a>"; $linkToContent = "<a class=\"cmsEditlink\" href=\"admin/show/$this->CopyContentFromID\">" .
_t('VirtualPage.EDITCONTENT', 'click here to edit the content') . "</a>";
$fields->addFieldToTab("Root.Content.Main", new LabelField($linkToContent, null, true), "Title"); $fields->addFieldToTab("Root.Content.Main", new LabelField($linkToContent, null, true), "Title");
} }

View File

@ -102,7 +102,7 @@ JS;
$result = DB::query( "SELECT COUNT(*) FROM " . $this->restrictedTable . " WHERE " . $this->restrictedField . " = '" . $this->value . "'" )->value(); $result = DB::query( "SELECT COUNT(*) FROM " . $this->restrictedTable . " WHERE " . $this->restrictedField . " = '" . $this->value . "'" )->value();
if( $result && ( $result > 0 ) ) { if( $result && ( $result > 0 ) ) {
$validator->validationError( $this->name, "The value entered is not unique" ); $validator->validationError( $this->name, _t('Form.VALIDATIONNOTUNIQUE', "The value entered is not unique") );
return false; return false;
} }

View File

@ -136,7 +136,7 @@ JS;
if(!$valid){ if(!$valid){
$validator->validationError( $validator->validationError(
$this->name, $this->name,
"Please enter a valid bank number", _t('Form.VALIDATIONBANKACC', "Please enter a valid bank number"),
"validation", "validation",
false false
); );

View File

@ -121,7 +121,7 @@ JS;
function validate($validator) { function validate($validator) {
// TODO Implement server-side validation // TODO Implement server-side validation
if($this->value == null) { if($this->value == null) {
$validator->validationError($this->name,"Please ensure you have set all date values","validation"); $validator->validationError($this->name,_t('Form.VALIDATIONALLDATEVALUES',"Please ensure you have set all date values"),"validation");
return false; return false;
} else { } else {
return true; return true;
@ -136,7 +136,7 @@ JS;
class CompositeDateField_Disabled extends DateField { class CompositeDateField_Disabled extends DateField {
function setValue($val) { function setValue($val) {
if($val && $val != "0000-00-00") $this->value = date('d/m/Y', strtotime($val)); if($val && $val != "0000-00-00") $this->value = date('d/m/Y', strtotime($val));
else $this->value = "(No date set)"; else $this->value = _t('Form.DATENOTSET', "(No date set)");
} }
function Field() { function Field() {
if($this->value) { if($this->value) {
@ -144,7 +144,7 @@ class CompositeDateField_Disabled extends DateField {
$df->setValue($this->dataValue()); $df->setValue($this->dataValue());
$val = Convert::raw2xml($this->value); $val = Convert::raw2xml($this->value);
} else { } else {
$val = '<i>(not set)</i>'; $val = '<i>' . _t('Form.NOTSET', '(not set)') . '</i>';
} }
return "<span class=\"readonly\" id=\"" . $this->id() . "\">$val</span>"; return "<span class=\"readonly\" id=\"" . $this->id() . "\">$val</span>";

View File

@ -22,8 +22,8 @@ class ConfirmedPasswordField extends FormField {
// naming with underscores to prevent values from actually being saved somewhere // naming with underscores to prevent values from actually being saved somewhere
$this->children = new FieldSet( $this->children = new FieldSet(
new PasswordField("{$name}[_Password]", 'Password'), new PasswordField("{$name}[_Password]", _t('Member.PASSWORD')),
new PasswordField("{$name}[_ConfirmPassword]",'Confirm Password') new PasswordField("{$name}[_ConfirmPassword]",_t('Member.CONFIRMPASSWORD', 'Confirm Password'))
); );
parent::__construct($name, $title, $value, $form); parent::__construct($name, $title, $value, $form);
@ -156,14 +156,14 @@ JS;
$passwordConfirmField->setValue($_POST[$name]['_ConfirmPassword']); $passwordConfirmField->setValue($_POST[$name]['_ConfirmPassword']);
// both password-fields should be the same // both password-fields should be the same
if($passwordField->Value() != $passwordConfirmField->Value()) { if($passwordField->Value() != $passwordConfirmField->Value()) {
$validator->validationError($name, "Passwords don't match", "validation", false); $validator->validationError($name, _t('Form.VALIDATIONPASSWORDSDONTMATCH',"Passwords don't match"), "validation", false);
return false; return false;
} }
if(!$this->canBeEmpty) { if(!$this->canBeEmpty) {
// both password-fields shouldn't be empty // both password-fields shouldn't be empty
if(!$passwordField->Value() || !$passwordConfirmField->Value()) { if(!$passwordField->Value() || !$passwordConfirmField->Value()) {
$validator->validationError($name, "Passwords can't be empty", "validation", false); $validator->validationError($name, _t('Form.VALIDATIONPASSWORDSNOTEMPTY', "Passwords can't be empty"), "validation", false);
return false; return false;
} }
} }
@ -193,7 +193,7 @@ JS;
if(!preg_match('/^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$/',$passwordField->Value())) { if(!preg_match('/^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$/',$passwordField->Value())) {
$validator->validationError( $validator->validationError(
'Password', 'Password',
"Passwords must have at least one digit and one alphanumeric character.", _t('Form.VALIDATIONSTRONGPASSWORD', "Passwords must have at least one digit and one alphanumeric character."),
"validation", "validation",
false false
); );

View File

@ -82,7 +82,15 @@ JS;
case 2: $number = "third"; break; case 2: $number = "third"; break;
case 3: $number = "fourth"; break; case 3: $number = "fourth"; break;
} }
$validator->validationError($this->name,"Please ensure you have entered the " . $number . " credit card number correctly.","validation",false); $validator->validationError(
$this->name,
sprintf(
_t('Form.VALIDATIONCREDITNUMBER', "Please ensure you have entered the %s credit card number correctly."),
$number
),
"validation",
false
);
return false; return false;
} }
$i++; $i++;

View File

@ -64,7 +64,7 @@ JS;
function validate() { function validate() {
if(!empty ($this->value) && !preg_match('/^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $this->value)) { if(!empty ($this->value) && !preg_match('/^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $this->value)) {
$validator->validationError($this->name, "Please enter a valid currency.", "validation", false); $validator->validationError($this->name, _t('Form.VALIDCURRENCY', "Please enter a valid currency."), "validation", false);
return false; return false;
} }
return true; return true;

View File

@ -61,7 +61,11 @@ class CustomRequiredFields extends RequiredFields{
}else if($fields->dataFieldByName($field)) { }else if($fields->dataFieldByName($field)) {
// if an error is found, the form is returned. // if an error is found, the form is returned.
if(!$data[$field]) { if(!$data[$field]) {
$this->validationError($field,"$field is required","required"); $this->validationError(
$field,
sprintf(_t('Form.FIELDISREQUIRED', "%s is required"), $field),
"required"
);
return false; return false;
} }
} }
@ -78,4 +82,4 @@ class CustomRequiredFields extends RequiredFields{
} }
} }
?> ?>

View File

@ -57,7 +57,12 @@ JS;
{ {
if(!empty ($this->value) && !preg_match('/^[0-9]{1,2}\/[0-9]{1,2}\/[0-90-9]{2,4}$/', $this->value)) if(!empty ($this->value) && !preg_match('/^[0-9]{1,2}\/[0-9]{1,2}\/[0-90-9]{2,4}$/', $this->value))
{ {
$validator->validationError($this->name, "Please enter a valid date format (DD/MM/YYYY).", "validation", false); $validator->validationError(
$this->name,
_t('DateField.VALIDDATEFORMAT', "Please enter a valid date format (DD/MM/YYYY)."),
"validation",
false
);
return false; return false;
} }
return true; return true;

View File

@ -10,7 +10,7 @@ class EditForm extends Form {
$this->data = $controller->data(); $this->data = $controller->data();
$actions = new FieldSet( $actions = new FieldSet(
new FormAction("save", "Save Changes") new FormAction("save", _t('Form.SAVECHANGES', "Save Changes"))
); );
$sequential = $fields->dataFields(); $sequential = $fields->dataFields();

View File

@ -42,7 +42,11 @@ JS;
function validate($validator){ function validate($validator){
$this->value = trim($this->value); $this->value = trim($this->value);
if($this->value && !ereg('^([a-zA-Z0-9_+\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$', $this->value)){ if($this->value && !ereg('^([a-zA-Z0-9_+\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$', $this->value)){
$validator->validationError($this->name,"Please enter an email address.","validation"); $validator->validationError(
$this->name,
_t('EmailField.VALIDATION', "Please enter an email address."),
"validation"
);
return false; return false;
} else{ } else{
return true; return true;

View File

@ -21,7 +21,7 @@ class FileIFrameField extends FileField {
return $iframe . $hiddenField; return $iframe . $hiddenField;
} else { } else {
$this->value = 'You can add files once you have saved for the first time.'; $this->value = _t('FileIframeField.NOTEADDFILES', 'You can add files once you have saved for the first time.');
return FormField::Field(); return FormField::Field();
} }
} }

View File

@ -418,7 +418,7 @@ class Form extends ViewableData {
if(Director::is_ajax()) { if(Director::is_ajax()) {
// Send validation errors back as JSON with a flag at the start // Send validation errors back as JSON with a flag at the start
//echo "VALIDATIONERROR:" . Convert::array2json($errors); //echo "VALIDATIONERROR:" . Convert::array2json($errors);
FormResponse::status_message('Validation failed', 'bad'); FormResponse::status_message(_t('Form.VALIDATIONFAILED', 'Validation failed'), 'bad');
foreach($errors as $error) { foreach($errors as $error) {
FormResponse::add(sprintf( FormResponse::add(sprintf(
"validationError('%s', '%s', '%s');\n", "validationError('%s', '%s', '%s');\n",

View File

@ -39,7 +39,7 @@ JS;
if(!$valid){ if(!$valid){
$validator->validationError( $validator->validationError(
$this->name, $this->name,
"Please enter a valid GST Number", _t('GSTNumberField.VALIDATION', "Please enter a valid GST Number"),
"validation", "validation",
false false
); );

View File

@ -232,73 +232,73 @@ class HtmlEditorField_Toolbar extends ViewableData {
function Buttons() { function Buttons() {
return new DataObjectSet( return new DataObjectSet(
new HtmlEditorField_button("Bold","bold","Bold (Ctrl+B)"), new HtmlEditorField_button("Bold","bold",_t('HtmlEditorField.BUTTONBOLD', "Bold (Ctrl+B)")),
new HtmlEditorField_button("Italic","italic","Italic (Ctrl+I)"), new HtmlEditorField_button("Italic","italic",_t('HtmlEditorField.BUTTONITALIC', "Italic (Ctrl+I)")),
new HtmlEditorField_button("Underline","underline", "Underline (Ctrl+U)"), new HtmlEditorField_button("Underline","underline", _t('HtmlEditorField.BUTTONUNDERLINE', "Underline (Ctrl+U)")),
new HtmlEditorField_button("Strikethrough","strikethrough"), new HtmlEditorField_button("Strikethrough","strikethrough", _t('HtmlEditorField.BUTTONSTRIKE', "strikethrough")),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("JustifyLeft","justifyleft","Align left"), new HtmlEditorField_button("JustifyLeft","justifyleft", _t('HtmlEditorField.BUTTONALIGNLEFT', "Align left")),
new HtmlEditorField_button("JustifyCenter","justifycenter","Align center"), new HtmlEditorField_button("JustifyCenter","justifycenter", _t('HtmlEditorField.BUTTONALIGNCENTER', "Align center")),
new HtmlEditorField_button("JustifyRight","justifyright","Align right"), new HtmlEditorField_button("JustifyRight","justifyright",_t('HtmlEditorField.BUTTONALIGNRIGHT',"Align right")),
new HtmlEditorField_button("JustifyFull","justifyfull","Justify"), new HtmlEditorField_button("JustifyFull","justifyfull",_t('HtmlEditorField.BUTTONALIGNJUSTIFY',"Justify")),
/*new HtmlEditorField_dropdown("mceSetCSSClass", "styleSelect", array( /*new HtmlEditorField_dropdown("mceSetCSSClass", "styleSelect", array(
"mceContentBody" => "mceContentBody", "mceContentBody" => "mceContentBody",
)),*/ )),*/
new HtmlEditorField_dropdown("FormatBlock", "formatSelect", array( new HtmlEditorField_dropdown("FormatBlock", "formatSelect", array(
"<p>" => "Paragraph", "<p>" => _t('HtmlEditorField.FORMATP', "Paragraph", PR_MEDIUM, '<p> tag'),
"<address>" => "Address", "<address>" => _t('HtmlEditorField.FORMATADDR', "Address", PR_MEDIUM, '<address> tag'),
"<pre>" => "Preformatted", "<pre>" => "Preformatted",_t('HtmlEditorField.FORMATADDR', "Address", PR_MEDIUM, '<address> tag'),
"<h1>" => "Heading 1", "<h1>" => _t('HtmlEditorField.FORMATH1', "Heading 1", PR_MEDIUM, '<h1> tag'),
"<h2>" => "Heading 2", "<h2>" => _t('HtmlEditorField.FORMATH2', "Heading 2", PR_MEDIUM, '<h2> tag'),
"<h3>" => "Heading 3", "<h3>" => _t('HtmlEditorField.FORMATH3', "Heading 3", PR_MEDIUM, '<h3> tag'),
"<h4>" => "Heading 4", "<h4>" => _t('HtmlEditorField.FORMATH4', "Heading 4", PR_MEDIUM, '<h4> tag'),
"<h5>" => "Heading 5", "<h5>" => _t('HtmlEditorField.FORMATH5', "Heading 5", PR_MEDIUM, '<h5> tag'),
"<h6>" => "Heading 6", "<h6>" => _t('HtmlEditorField.FORMATH6', "Heading 6", PR_MEDIUM, '<h6> tag'),
)), )),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("InsertUnorderedList","bullist","Bullet-point list"), new HtmlEditorField_button("InsertUnorderedList","bullist",_t('HtmlEditorField.BULLETLIST', "Bullet-point list")),
new HtmlEditorField_button("InsertOrderedList","numlist","Numbered list"), new HtmlEditorField_button("InsertOrderedList","numlist",_t('HtmlEditorField.OL', "Numbered list")),
new HtmlEditorField_button("Outdent","outdent","Decrease outdent"), new HtmlEditorField_button("Outdent","outdent",_t('HtmlEditorField.OUTDENT', "Decrease outdent")),
new HtmlEditorField_button("Indent","indent","Increase indent"), new HtmlEditorField_button("Indent","indent",_t('HtmlEditorField.INDENT', "Increase indent")),
new HtmlEditorField_button("inserthorizontalrule","hr","Insert horizontal line"), new HtmlEditorField_button("inserthorizontalrule","hr",_t('HtmlEditorField.HR', "Insert horizontal line")),
new HtmlEditorField_button("mceCharMap","charmap","Insert symbol"), new HtmlEditorField_button("mceCharMap","charmap",_t('HtmlEditorField.CHARMAP', "Insert symbol")),
new HtmlEditorField_break(), new HtmlEditorField_break(),
new HtmlEditorField_button("Undo","undo","Undo (Ctrl+Z)"), new HtmlEditorField_button("Undo","undo",_t('HtmlEditorField.UNDO', "Undo (Ctrl+Z)")),
new HtmlEditorField_button("Redo","redo","Redo (Ctrl+Y)"), new HtmlEditorField_button("Redo","redo",_t('HtmlEditorField.REDO', "Redo (Ctrl+Y)")),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("Cut","cut","Cut (Ctrl+X)"), new HtmlEditorField_button("Cut","cut",_t('HtmlEditorField.CUT', "Cut (Ctrl+X)")),
new HtmlEditorField_button("Copy","copy","Copy (Ctrl+C)"), new HtmlEditorField_button("Copy","copy",_t('HtmlEditorField.COPY', "Copy (Ctrl+C)")),
new HtmlEditorField_button("Paste","paste","Paste (Ctrl+V)"), new HtmlEditorField_button("Paste","paste",_t('HtmlEditorField.PASTE', "Paste (Ctrl+V)")),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("ssImage","image","Insert image"), new HtmlEditorField_button("ssImage","image",_t('HtmlEditorField.IMAGE', "Insert image")),
new HtmlEditorField_button("ssFlash","flash:flash","Insert flash"), new HtmlEditorField_button("ssFlash","flash:flash",_t('HtmlEditorField.FLASH', "Insert flash")),
new HtmlEditorField_button("ssLink","link","Insert/edit link for highlighted text"), new HtmlEditorField_button("ssLink","link",_t('HtmlEditorField.LINK', "Insert/edit link for highlighted text")),
new HtmlEditorField_button("unlink","unlink","Remove link"), new HtmlEditorField_button("unlink","unlink",_t('HtmlEditorField.UNLINK', "Remove link")),
new HtmlEditorField_button("mceInsertAnchor","anchor","Insert/edit anchor"), new HtmlEditorField_button("mceInsertAnchor","anchor",_t('HtmlEditorField.ANCHOR', "Insert/edit anchor")),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("mceCodeEditor","code","Edit HTML Code"), new HtmlEditorField_button("mceCodeEditor","code",_t('HtmlEditorField.EDITCODE', "Edit HTML Code")),
// We don't need this because tinymce is good at auto-tidying // We don't need this because tinymce is good at auto-tidying
// new HtmlEditorField_button("mceCleanup","cleanup","Clean up code"), // new HtmlEditorField_button("mceCleanup","cleanup","Clean up code"),
new HtmlEditorField_button("mceToggleVisualAid","visualaid","Show/hide guidelines"), new HtmlEditorField_button("mceToggleVisualAid","visualaid",_t('HtmlEditorField.VISUALAID', "Show/hide guidelines")),
new HtmlEditorField_separator(), new HtmlEditorField_separator(),
new HtmlEditorField_button("mceInsertTable","table:table","Insert table"), new HtmlEditorField_button("mceInsertTable","table:table",_t('HtmlEditorField.INSERTTABLE', "Insert table")),
new HtmlEditorField_button("mceTableInsertRowBefore","table:table_insert_row_before","Insert row before"), new HtmlEditorField_button("mceTableInsertRowBefore","table:table_insert_row_before",_t('HtmlEditorField.INSERTROWBEF', "Insert row before")),
new HtmlEditorField_button("mceTableInsertRowAfter","table:table_insert_row_after","Insert row after"), new HtmlEditorField_button("mceTableInsertRowAfter","table:table_insert_row_after",_t('HtmlEditorField.INSERTROWAFTER', "Insert row after")),
new HtmlEditorField_button("mceTableDeleteRow","table:table_delete_row","Delete row"), new HtmlEditorField_button("mceTableDeleteRow","table:table_delete_row",_t('HtmlEditorField.DELETEROW', "Delete row")),
new HtmlEditorField_button("mceTableInsertColBefore","table:table_insert_col_before","Insert column before"), new HtmlEditorField_button("mceTableInsertColBefore","table:table_insert_col_before",_t('HtmlEditorField.INSERTCOLBEF', "Insert column before")),
new HtmlEditorField_button("mceTableInsertColAfter","table:table_insert_col_after","Insert column after"), new HtmlEditorField_button("mceTableInsertColAfter","table:table_insert_col_after",_t('HtmlEditorField.INSERTCOLAFTER', "Insert column after")),
new HtmlEditorField_button("mceTableDeleteCol","table:table_delete_col","Delete column") new HtmlEditorField_button("mceTableDeleteCol","table:table_delete_col",_t('HtmlEditorField.DELETECOL', "Delete column"))
); );
} }
@ -312,25 +312,25 @@ class HtmlEditorField_Toolbar extends ViewableData {
$this->controller, $this->controller,
"{$this->name}.LinkForm", "{$this->name}.LinkForm",
new FieldSet( new FieldSet(
new OptionsetField("LinkType", "Link to", new OptionsetField("LinkType", _t('HtmlEditorField.LINKTO', "Link to"),
array( array(
"internal" => "Page on the site", "internal" => _t('HtmlEditorField.LINKINTERNAL',"Page on the site"),
"external" => "Another website", "external" => _t('HtmlEditorField.LINKEXTERNAL',"Another website"),
"email" => "Email address", "email" => _t('HtmlEditorField.LINKEMAIL', "Email address"),
"file" => "Download a file", "file" => _t('HtmlEditorField.LINKFILE', "Download a file"),
) )
), ),
new TreeDropdownField("internal", "Page", "SiteTree", "URLSegment"), new TreeDropdownField("internal", _t('HtmlEditorField.PAGE', "Page"), "SiteTree", "URLSegment"),
new TextField("external", "URL"), new TextField("external", _t('HtmlEditorField.URL', "URL")),
new EmailField("email", "Email address"), new EmailField("email", _t('HtmlEditorField.EMAIL', "Email address")),
new TreeDropdownField("file","File","File", "Filename"), new TreeDropdownField("file",_t('HtmlEditorField.FILE', "File"),"File", "Filename"),
new TextField("Description", "Link description"), new TextField("Description", _t('HtmlEditorField.LINKDESCR', "Link description")),
new CheckboxField("TargetBlank", "Open link in a new window?") new CheckboxField("TargetBlank", _t('HtmlEditorField.LINKOPENNEWWIN', "Open link in a new window?"))
), ),
new FieldSet( new FieldSet(
new FormAction("insert", "Insert link"), new FormAction("insert", _t('HtmlEditorField.BUTTONINSERTLINK', "Insert link")),
new FormAction("remove", "Remove link"), new FormAction("remove", _t('HtmlEditorField.BUTTONREMOVELINK', "Remove link")),
new FormAction("cancel", "Cancel") new FormAction("cancel", _t('HtmlEditorField.BUTTONCANCEL', "Cancel"))
) )
); );
$form->loadDataFrom($this); $form->loadDataFrom($this);
@ -340,15 +340,15 @@ class HtmlEditorField_Toolbar extends ViewableData {
function ImageForm() { function ImageForm() {
$form = new Form($this->controller, "{$this->name}.ImageForm", $form = new Form($this->controller, "{$this->name}.ImageForm",
new FieldSet( new FieldSet(
new TreeDropdownField("FolderID", "Folder", "Folder"), new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER', "Folder"), "Folder"),
new ThumbnailStripField("Image", "FolderID", "getimages"), new ThumbnailStripField("Image", "FolderID", "getimages"),
new TextField("AltText", "Description", "", 80), new TextField("AltText", _t('HtmlEditorField.ALTTEXT', "Description"), "", 80),
new DropdownField("CSSClass", "Alignment / style", array( new DropdownField("CSSClass", _t('HtmlEditorField.CSSCLASS', "Alignment / style"), array(
"left" => "On the left, with text wrapping around.", "left" => _t('HtmlEditorField.CSSCLASSLEFT', "On the left, with text wrapping around."),
"right" => "On the right, with text wrapping around.", "right" => _t('HtmlEditorField.CSSCLASSRIGHT', "On the right, with text wrapping around."),
"center" => "Centred, on its own.", "center" => _t('HtmlEditorField.CSSCLASSCENTER', "Centred, on its own."),
)), )),
new FieldGroup("Dimensions", new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"),
new TextField("Width", "", "", 5), new TextField("Width", "", "", 5),
new TextField("Height", "x", "", 5) new TextField("Height", "x", "", 5)
) )
@ -367,10 +367,10 @@ class HtmlEditorField_Toolbar extends ViewableData {
function FlashForm() { function FlashForm() {
$form = new Form($this->controller, "{$this->name}.FlashForm", $form = new Form($this->controller, "{$this->name}.FlashForm",
new FieldSet( new FieldSet(
new TreeDropdownField("FolderID", "Folder", "Folder"), new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER'), "Folder"),
new ThumbnailStripField("Flash", "FolderID", "getflash"), new ThumbnailStripField("Flash", "FolderID", "getflash"),
new TextField("Width", "Width (px)"), new TextField('Width', _t('HtmlEditorField.IMAGEWIDTHPX', "Width (px)")),
new TextField("Height", "Height (px)") new TextField('Height', _t('HtmlEditorField.IMAGEHEIGHTPX', "Height (px)"))
), ),
new FieldSet() new FieldSet()
); );

View File

@ -28,7 +28,7 @@ class ImageField extends FileField {
return $iframe . $hiddenField; return $iframe . $hiddenField;
} else { } else {
$this->value = 'You can add images once you have saved for the first time.'; $this->value = _t('ImageField.NOTEADDIMAGES', 'You can add images once you have saved for the first time.');
return FormField::Field(); return FormField::Field();
} }
} }

View File

@ -45,9 +45,11 @@ class LanguageDropdownField extends GroupedDropdownField {
asort($alllangs); asort($alllangs);
if (count($usedlangs)) { if (count($usedlangs)) {
asort($usedlangs); asort($usedlangs);
$labelAvail = _t('Form.LANGAVAIL', "Available languages");
$labelOther = _t('Form.LANGAOTHER', "Other languages");
parent::__construct($name, $title, array( parent::__construct($name, $title, array(
"Available languages" => $usedlangs, $labelAvail => $usedlangs,
"Other languages" => $alllangs $labelOther => $alllangs
), ),
reset($usedlangs) reset($usedlangs)
); );

View File

@ -42,7 +42,14 @@ JS;
/** PHP Validation **/ /** PHP Validation **/
function validate($validator){ function validate($validator){
if($this->value && !is_numeric($this->value)){ if($this->value && !is_numeric($this->value)){
$validator->validationError($this->name,"'$this->value' is not a number, only numbers can be accepted for this field","validation"); $validator->validationError(
$this->name,
sprintf(
_t('NumericField.VALIDATION', "'%s' is not a number, only numbers can be accepted for this field"),
$this->value
),
"validation"
);
return false; return false;
} else{ } else{
return true; return true;

View File

@ -158,7 +158,7 @@ JS;
if(!$valid){ if(!$valid){
$validator->validationError( $validator->validationError(
$this->name, $this->name,
"Please enter a valid phone number", _t('PhoneNumberField.VALIDATION', "Please enter a valid phone number"),
"validation", "validation",
false false
); );

View File

@ -95,7 +95,14 @@ JS;
if($this->required) { if($this->required) {
foreach($this->required as $field) { foreach($this->required as $field) {
if($fields->dataFieldByName($field) && !$data[$field]) { if($fields->dataFieldByName($field) && !$data[$field]) {
$this->validationError($field,'"' . strip_tags($field) . '" is required',"required"); $this->validationError(
$field,
sprintf(
_t('Form.FIELDISREQUIRED'),
strip_tags($field)
),
"required"
);
$valid = false; $valid = false;
} }
} }

View File

@ -61,7 +61,7 @@ class SimpleImageField_Disabled extends FormField {
elseif($imageField->CMSThumbnail()) $field .= "<img src=\"".$imageField->CMSThumbnail()->URL()."\" />"; elseif($imageField->CMSThumbnail()) $field .= "<img src=\"".$imageField->CMSThumbnail()->URL()."\" />";
else {} // This shouldn't be called but it sometimes is for some reason, so we don't do anything else {} // This shouldn't be called but it sometimes is for some reason, so we don't do anything
}else{ }else{
$field .= "<label>No Image Uploaded</label>"; $field .= "<label>" . _t('SimpleImageField.NOUPLOAD', 'No Image Uploaded') . "</label>";
} }
$field .= "</div>"; $field .= "</div>";
return $field; return $field;

View File

@ -563,7 +563,12 @@ JS;
if($fieldObj = $fields->dataFieldByName($cellName)) { if($fieldObj = $fields->dataFieldByName($cellName)) {
if(!trim($fieldObj->Value())){ if(!trim($fieldObj->Value())){
$title = $fieldObj->Title(); $title = $fieldObj->Title();
$errorMessage .= "In $this->name '$title' is required.<br />"; $errorMessage .= sprintf(
_t('TableField.ISREQUIRED', "In %s '%s' is required."),
$this->name,
$title
);
$errorMessage .= "<br />";
} }
} }
} }

View File

@ -41,7 +41,7 @@ class TreeDropdownField extends FormField {
$record = DataObject::get_by_id($this->sourceObject, $this->value); $record = DataObject::get_by_id($this->sourceObject, $this->value);
$title = $record->Title; $title = $record->Title;
} else { } else {
$title = "(Choose)"; $title = _t('DropdownField.CHOOSE', "(Choose)", PR_MEDIUM, 'Start-value of a dropdown');
} }
$id = $this->id(); $id = $this->id();

View File

@ -8,7 +8,7 @@ class TypeDropdown extends DropdownField {
$options = DataObject::get( $className ); $options = DataObject::get( $className );
$optionArray = array( '0' => 'None' ); $optionArray = array( '0' => _t('TypeDropdown.NONE', 'None') );
foreach( $options as $option ) foreach( $options as $option )
$optionArray[$option->ID] = $option->Title; $optionArray[$option->ID] = $option->Title;

12
javascript/i18n.js Normal file
View File

@ -0,0 +1,12 @@
/**
* Misc helpers
*/
var i18n = Class.create();
i18n = {
}
var _t = function() {
}

26
lang/de_DE.php Normal file
View File

@ -0,0 +1,26 @@
<?php
i18n::include_locale_file('sapphire', 'en_US');
global $lang;
$lang['de_DE'] = $lang['en_US'];
$lang['de_DE']['Member']['REFRESHLANG'] = 'Sie haben die Sprache Ihrer Benutzeroberfläche geändert. Bitte laden Sie dieses Browserfenster neu.';
$lang['de_DE']['ToggleField']['MORE'] = 'mehr';
$lang['de_DE']['ToggleField']['LESS'] = 'weniger';
$lang['de_DE']['Member']['FIRSTNAME'] = 'Vorname';
$lang['de_DE']['Member']['SURNAME'] = 'Nachname';
$lang['de_DE']['Member']['EMAIL'] = 'Email';
$lang['de_DE']['Member']['PASSWORD'] = 'Passwort';
$lang['de_DE']['Member']['PERSONALDETAILS'] = 'Persönliche Daten';
$lang['de_DE']['Member']['USERDETAILS'] = 'Benutzerdaten';
$lang['de_DE']['Member']['INTERFACELANG'] = 'CMS Sprache';
$lang['de_DE']['Member']['EMAILSIGNUPSUBJECT'] = 'Vielen Dank für Ihr Interesse';
$lang['de_DE']['Member']['NAME'] = 'Name';
$lang['de_DE']['Member']['PHONE'] = 'Telefon';
$lang['de_DE']['Member']['MOBILE'] = 'Mobil';
$lang['de_DE']['Member']['ADDRESS'] = 'Adresse';
$lang['de_DE']['']['WELCOME'] = 'Willkommen';
?>

View File

@ -2,6 +2,354 @@
global $lang; global $lang;
$lang['en_US']['Member']['REFRESHLANG'] = 'You have changed the interface language. Please refresh your browser window for the changes to take effect'; $lang['en_US']['ErrorPage']['CODE'] = 'Error code';
$lang['en_US']['GhostPage']['NOLINKED'] = 'This ghost page has no linked page.';
$lang['en_US']['Controller']['IMAGE'] = 'Image';
$lang['en_US']['Controller']['FILE'] = 'File';
$lang['en_US']['ImageUploader']['REPLACE'] = array(
'Replace %s',
PR_MEDIUM,
'Replace file/image'
);
$lang['en_US']['ImageUploader']['ONEFROMCOMPUTER'] = 'With one from your computer';
$lang['en_US']['ImageUplaoder']['ONEFROMFILESTORE'] = 'With one from the file store';
$lang['en_US']['ImageUploader']['ATTACH'] = array(
'Attach %s',
PR_MEDIUM,
'Attach image/file'
);
$lang['en_US']['ImageUploader']['FROMCOMPUTER'] = 'From your computer';
$lang['en_US']['ImageUploader']['FROMFILESTORE'] = 'From the file store';
$lang['en_US']['ImageUploader']['DELETE'] = array(
'Delete %s',
PR_MEDIUM,
'Delete file/image'
);
$lang['en_US']['ImageUploader']['CLICKREMOVE'] = array(
'Click the button below to remove this %s.',
PR_MEDIUM,
'... this image/file'
);
$lang['en_US']['ImageUploader']['REALLYDELETE'] = 'Do you really want to remove this %s?';
$lang['en_US']['RedirectorPage']['HEADER'] = 'This page will redirect users to another page';
$lang['en_US']['RedirectorPage']['REDIRECTTO'] = 'Redirect to';
$lang['en_US']['RedirectorPage']['REDIRECTTOPAGE'] = 'A page on your website';
$lang['en_US']['RedirectorPage']['REDIRECTTOEXTERNAL'] = 'Another website';
$lang['en_US']['RedirectorPage']['YOURPAGE'] = 'Page on your website';
$lang['en_US']['RedirectorPage']['OTHERURL'] = 'Other website URL';
$lang['en_US']['RedirectorPage']['HASBEENSETUP'] = 'A redirector page has been set up without anywhere to redirect to.';
$lang['en_US']['SiteTree']['LINKSCHANGEDTO'] = ' changed %s -> %s';
$lang['en_US']['SiteTree']['LINKSALREADYUNIQUE'] = ' %s is already unique';
$lang['en_US']['SiteTree']['PAGESLINKING'] = 'The following pages link to this page:';
$lang['en_US']['SiteTree']['NOBACKLINKS'] = 'This page hasn\'t been linked to from any pages.';
$lang['en_US']['SiteTree']['TOPLEVEL'] = 'Site Content (Top Level)';
$lang['en_US']['SiteTree']['APPEARSVIRTUALPAGES'] = 'This content also appears on the virtual pages in the %s sections.';
$lang['en_US']['SiteTree']['HASBROKENLINKS'] = 'This page has broken links.';
$lang['en_US']['SiteTree']['PAGETITLE'] = 'Page name';
$lang['en_US']['SiteTree']['MENUTITLE'] = 'Navigation label';
$lang['en_US']['SiteTree']['HTMLEDITORTITLE'] = array(
'Content',
PR_MEDIUM,
'HTML editor title'
);
$lang['en_US']['SiteTree']['URL'] = 'URL';
$lang['en_US']['SiteTree']['VALIDATIONURLSEGMENT1'] = 'Another page is using that URL. URL must be unique for each page';
$lang['en_US']['SiteTree']['VALIDATIONURLSEGMENT2'] = 'URLs can only be made up of letters, digits and hyphens.';
$lang['en_US']['SiteTree']['METAHEADER'] = 'Search Engine Meta-tags';
$lang['en_US']['SiteTree']['METATITLE'] = 'Title';
$lang['en_US']['SiteTree']['METADESC'] = 'Description';
$lang['en_US']['SiteTree']['METAKEYWORDS'] = 'Keywords';
$lang['en_US']['SiteTree']['METAADVANCEDHEADER'] = 'Advanced Options...';
$lang['en_US']['SiteTree']['METAEXTRA'] = 'Custom Meta Tags';
$lang['en_US']['SiteTree']['METANOTEPRIORITY'] = 'Manually specify a Priority for this page:
(valid values are from 0 to 1, a zero will remove this page from the index)';
$lang['en_US']['SiteTree']['METAPAGEPRIO'] = 'Page Priority';
$lang['en_US']['SiteTree']['PAGETYPE'] = array(
'Page type',
PR_MEDIUM,
'Classname of a page object'
);
$lang['en_US']['SiteTree']['SHOWINMENUS'] = 'Show in menus?';
$lang['en_US']['SiteTree']['SHOWINSEARCH'] = 'Show in search?';
$lang['en_US']['SiteTree']['ALLOWCOMMENTS'] = 'Allow comments on this page?';
$lang['en_US']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Use this page as the \'home page\' for the following domains:
(separate multiple domains with commas)';
$lang['en_US']['SiteTree']['HOMEPAGEFORDOMAIN'] = array(
'Domain(s)',
PR_MEDIUM,
'Listing domains that should be used as homepage'
);
$lang['en_US']['SiteTree']['ACCESSHEADER'] = 'Who can view this page on my site?';
$lang['en_US']['SiteTree']['ACCESSANYONE'] = 'Anyone';
$lang['en_US']['SiteTree']['ACCESSLOGGEDIN'] = 'Logged-in users';
$lang['en_US']['SiteTree']['ACCESSONLYTHESE'] = 'Only these people (choose from list)';
$lang['en_US']['SiteTree']['GROUP'] = 'Group';
$lang['en_US']['SiteTree']['EDITHEADER'] = 'Who can edit this inside the CMS?';
$lang['en_US']['SiteTree']['EDITANYONE'] = 'Anyone who can log-in to the CMS';
$lang['en_US']['SiteTree']['EDITONLYTHESE'] = 'Only these people (choose from list)';
$lang['en_US']['SiteTree']['TABCONTENT'] = 'Content';
$lang['en_US']['SiteTree']['TABMAIN'] = 'Main';
$lang['en_US']['SiteTree']['TABMETA'] = 'Meta-data';
$lang['en_US']['SiteTree']['TABBEHAVIOUR'] = 'Behaviour';
$lang['en_US']['SiteTree']['TABREPORTS'] = 'Reports';
$lang['en_US']['SiteTree']['TABACCESS'] = 'Access';
$lang['en_US']['SiteTree']['TABBACKLINKS'] = 'BackLinks';
$lang['en_US']['SiteTree']['BUTTONUNPUBLISH'] = 'Unpublish';
$lang['en_US']['SiteTree']['BUTTONUNPUBLISHDESC'] = 'Remove this page from the published site';
$lang['en_US']['SiteTree']['BUTTONCANCELDRAFT'] = 'Cancel draft changes';
$lang['en_US']['SiteTree']['BUTTONCANCELDRAFTDESC'] = 'Delete your draft and revert to the currently published page';
$lang['en_US']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Save & Publish';
$lang['en_US']['SiteTree']['REMOVEDFROMDRAFT'] = 'Removed from draft site';
$lang['en_US']['SiteTree']['ADDEDTODRAFT'] = 'Added to draft site';
$lang['en_US']['SiteTree']['MODIFIEDONDRAFT'] = 'Modified on draft site';
$lang['en_US']['VirtualPage']['CHOOSE'] = 'Choose a page to link to';
$lang['en_US']['VirtualPage']['HEADER'] = 'This is a virtual page';
$lang['en_US']['VirtualPage']['EDITCONTENT'] = 'click here to edit the content';
$lang['en_US']['Form']['VALIDATIONNOTUNIQUE'] = 'The value entered is not unique';
$lang['en_US']['Form']['VALIDATIONBANKACC'] = 'Please enter a valid bank number';
$lang['en_US']['Form']['VALIDATIONALLDATEVALUES'] = 'Please ensure you have set all date values';
$lang['en_US']['Form']['DATENOTSET'] = '(No date set)';
$lang['en_US']['Form']['NOTSET'] = '(not set)';
$lang['en_US']['Member']['CONFIRMPASSWORD'] = 'Confirm Password';
$lang['en_US']['Form']['VALIDATIONPASSWORDSDONTMATCH'] = 'Passwords don\'t match';
$lang['en_US']['Form']['VALIDATIONPASSWORDSNOTEMPTY'] = 'Passwords can\'t be empty';
$lang['en_US']['Form']['VALIDATIONSTRONGPASSWORD'] = 'Passwords must have at least one digit and one alphanumeric character.';
$lang['en_US']['Form']['VALIDATIONCREDITNUMBER'] = 'Please ensure you have entered the %s credit card number correctly.';
$lang['en_US']['Form']['VALIDCURRENCY'] = 'Please enter a valid currency.';
$lang['en_US']['Form']['FIELDISREQUIRED'] = '%s is required';
$lang['en_US']['DateField']['VALIDDATEFORMAT'] = 'Please enter a valid date format (DD/MM/YYYY).';
$lang['en_US']['Form']['SAVECHANGES'] = 'Save Changes';
$lang['en_US']['EmailField']['VALIDATION'] = 'Please enter an email address.';
$lang['en_US']['FileIframeField']['NOTEADDFILES'] = 'You can add files once you have saved for the first time.';
$lang['en_US']['Form']['VALIDATIONFAILED'] = 'Validation failed';
$lang['en_US']['GSTNumberField']['VALIDATION'] = 'Please enter a valid GST Number';
$lang['en_US']['HtmlEditorField']['BUTTONBOLD'] = 'Bold (Ctrl+B)';
$lang['en_US']['HtmlEditorField']['BUTTONITALIC'] = 'Italic (Ctrl+I)';
$lang['en_US']['HtmlEditorField']['BUTTONUNDERLINE'] = 'Underline (Ctrl+U)';
$lang['en_US']['HtmlEditorField']['BUTTONSTRIKE'] = 'strikethrough';
$lang['en_US']['HtmlEditorField']['BUTTONALIGNLEFT'] = 'Align left';
$lang['en_US']['HtmlEditorField']['BUTTONALIGNCENTER'] = 'Align center';
$lang['en_US']['HtmlEditorField']['BUTTONALIGNRIGHT'] = 'Align right';
$lang['en_US']['HtmlEditorField']['BUTTONALIGNJUSTIFY'] = 'Justify';
$lang['en_US']['HtmlEditorField']['FORMATP'] = array(
'Paragraph',
PR_MEDIUM,
'<p> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATADDR'] = array(
'Address',
PR_MEDIUM,
'<address> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH1'] = array(
'Heading 1',
PR_MEDIUM,
'<h1> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH2'] = array(
'Heading 2',
PR_MEDIUM,
'<h2> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH3'] = array(
'Heading 3',
PR_MEDIUM,
'<h3> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH4'] = array(
'Heading 4',
PR_MEDIUM,
'<h4> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH5'] = array(
'Heading 5',
PR_MEDIUM,
'<h5> tag'
);
$lang['en_US']['HtmlEditorField']['FORMATH6'] = array(
'Heading 6',
PR_MEDIUM,
'<h6> tag'
);
$lang['en_US']['HtmlEditorField']['BULLETLIST'] = 'Bullet-point list';
$lang['en_US']['HtmlEditorField']['OL'] = 'Numbered list';
$lang['en_US']['HtmlEditorField']['OUTDENT'] = 'Decrease outdent';
$lang['en_US']['HtmlEditorField']['INDENT'] = 'Increase indent';
$lang['en_US']['HtmlEditorField']['HR'] = 'Insert horizontal line';
$lang['en_US']['HtmlEditorField']['CHARMAP'] = 'Insert symbol';
$lang['en_US']['HtmlEditorField']['UNDO'] = 'Undo (Ctrl+Z)';
$lang['en_US']['HtmlEditorField']['REDO'] = 'Redo (Ctrl+Y)';
$lang['en_US']['HtmlEditorField']['CUT'] = 'Cut (Ctrl+X)';
$lang['en_US']['HtmlEditorField']['COPY'] = 'Copy (Ctrl+C)';
$lang['en_US']['HtmlEditorField']['PASTE'] = 'Paste (Ctrl+V)';
$lang['en_US']['HtmlEditorField']['IMAGE'] = 'Insert image';
$lang['en_US']['HtmlEditorField']['FLASH'] = 'Insert flash';
$lang['en_US']['HtmlEditorField']['LINK'] = 'Insert/edit link for highlighted text';
$lang['en_US']['HtmlEditorField']['UNLINK'] = 'Remove link';
$lang['en_US']['HtmlEditorField']['ANCHOR'] = 'Insert/edit anchor';
$lang['en_US']['HtmlEditorField']['EDITCODE'] = 'Edit HTML Code';
$lang['en_US']['HtmlEditorField']['VISUALAID'] = 'Show/hide guidelines';
$lang['en_US']['HtmlEditorField']['INSERTTABLE'] = 'Insert table';
$lang['en_US']['HtmlEditorField']['INSERTROWBEF'] = 'Insert row before';
$lang['en_US']['HtmlEditorField']['INSERTROWAFTER'] = 'Insert row after';
$lang['en_US']['HtmlEditorField']['DELETEROW'] = 'Delete row';
$lang['en_US']['HtmlEditorField']['INSERTCOLBEF'] = 'Insert column before';
$lang['en_US']['HtmlEditorField']['INSERTCOLAFTER'] = 'Insert column after';
$lang['en_US']['HtmlEditorField']['DELETECOL'] = 'Delete column';
$lang['en_US']['HtmlEditorField']['LINKTO'] = 'Link to';
$lang['en_US']['HtmlEditorField']['LINKINTERNAL'] = 'Page on the site';
$lang['en_US']['HtmlEditorField']['LINKEXTERNAL'] = 'Another website';
$lang['en_US']['HtmlEditorField']['LINKEMAIL'] = 'Email address';
$lang['en_US']['HtmlEditorField']['LINKFILE'] = 'Download a file';
$lang['en_US']['HtmlEditorField']['PAGE'] = 'Page';
$lang['en_US']['HtmlEditorField']['URL'] = 'URL';
$lang['en_US']['HtmlEditorField']['EMAIL'] = 'Email address';
$lang['en_US']['HtmlEditorField']['FILE'] = 'File';
$lang['en_US']['HtmlEditorField']['LINKDESCR'] = 'Link description';
$lang['en_US']['HtmlEditorField']['LINKOPENNEWWIN'] = 'Open link in a new window?';
$lang['en_US']['HtmlEditorField']['BUTTONINSERTLINK'] = 'Insert link';
$lang['en_US']['HtmlEditorField']['BUTTONREMOVELINK'] = 'Remove link';
$lang['en_US']['HtmlEditorField']['BUTTONCANCEL'] = 'Cancel';
$lang['en_US']['HtmlEditorField']['FOLDER'] = 'Folder';
$lang['en_US']['HtmlEditorField']['ALTTEXT'] = 'Description';
$lang['en_US']['HtmlEditorField']['CSSCLASS'] = 'Alignment / style';
$lang['en_US']['HtmlEditorField']['CSSCLASSLEFT'] = 'On the left, with text wrapping around.';
$lang['en_US']['HtmlEditorField']['CSSCLASSRIGHT'] = 'On the right, with text wrapping around.';
$lang['en_US']['HtmlEditorField']['CSSCLASSCENTER'] = 'Centred, on its own.';
$lang['en_US']['HtmlEditorField']['IMAGEDIMENSIONS'] = 'Dimensions';
$lang['en_US']['HtmlEditorField']['IMAGEWIDTHPX'] = 'Width (px)';
$lang['en_US']['HtmlEditorField']['IMAGEHEIGHTPX'] = 'Height (px)';
$lang['en_US']['ImageField']['NOTEADDIMAGES'] = 'You can add images once you have saved for the first time.';
$lang['en_US']['Form']['LANGAVAIL'] = 'Available languages';
$lang['en_US']['Form']['LANGAOTHER'] = 'Other languages';
$lang['en_US']['NumericField']['VALIDATION'] = '\'%s\' is not a number, only numbers can be accepted for this field';
$lang['en_US']['PhoneNumberField']['VALIDATION'] = 'Please enter a valid phone number';
$lang['en_US']['SimpleImageField']['NOUPLOAD'] = 'No Image Uploaded';
$lang['en_US']['TableField']['ISREQUIRED'] = 'In %s \'%s\' is required.';
$lang['en_US']['ToggleField']['MORE'] = 'more';
$lang['en_US']['ToggleField']['LESS'] = 'less';
$lang['en_US']['DropdownField']['CHOOSE'] = array(
'(Choose)',
PR_MEDIUM,
'Start-value of a dropdown'
);
$lang['en_US']['TypeDropdown']['NONE'] = 'None';
$lang['en_US']['BasicAuth']['ERRORNOTREC'] = 'That username / password isn\'t recognised';
$lang['en_US']['BasicAuth']['ENTERINFO'] = 'Please enter a username and password.';
$lang['en_US']['BasicAuth']['ERRORNOTADMIN'] = 'That user is not an administrator.';
$lang['en_US']['Member']['YOUROLDPASSWORD'] = 'Your old password';
$lang['en_US']['Member']['NEWPASSWORD'] = 'New Password';
$lang['en_US']['Member']['CONFIRMNEWPASSWORD'] = 'Confirm New Password';
$lang['en_US']['Member']['BUTTONCHANGEPASSWORD'] = 'Change Password';
$lang['en_US']['Member']['ERRORPASSWORDNOTMATCH'] = 'Your current password does not match, please try again';
$lang['en_US']['Member']['PASSWORDCHANGED'] = 'Your password has been changed, and a copy emailed to you.';
$lang['en_US']['Member']['ERRORNEWPASSWORD'] = 'Your have entered your new password differently, try again';
$lang['en_US']['Member']['FIRSTNAME'] = 'First Name';
$lang['en_US']['Member']['SURNAME'] = 'Surname';
$lang['en_US']['Member']['EMAIL'] = array(
'Email',
PR_MEDIUM,
'Noun'
);
$lang['en_US']['Member']['PASSWORD'] = 'Password';
$lang['en_US']['Member']['PERSONALDETAILS'] = array(
'Personal Details',
PR_MEDIUM,
'Headline for formfields'
);
$lang['en_US']['Member']['USERDETAILS'] = array(
'User Details',
PR_MEDIUM,
'Headline for formfields'
);
$lang['en_US']['Member']['INTERFACELANG'] = array(
'Interface Language',
PR_MEDIUM,
'Language of the CMS'
);
$lang['en_US']['Member']['EMAILSIGNUPSUBJECT'] = 'Thanks for signing up';
$lang['en_US']['']['WELCOME'] = 'Welcome';
$lang['en_US']['Member']['EMAILSIGNUPINTRO1'] = 'Thanks for signing up to become a new member, your details are listed below for future reference.';
$lang['en_US']['Member']['EMAILSIGNUPINTRO2'] = 'You can login to the website using the credentials listed below';
$lang['en_US']['Member']['CONTACTINFO'] = 'Contact Information';
$lang['en_US']['Member']['NAME'] = 'Name';
$lang['en_US']['Member']['PHONE'] = 'Phone';
$lang['en_US']['Member']['MOBILE'] = 'Mobile';
$lang['en_US']['Member']['ADDRESS'] = 'Address';
$lang['en_US']['Member']['SUBJECTPASSWORDCHANGED'] = array(
'Your password has been changed',
PR_MEDIUM,
'Email subject'
);
$lang['en_US']['Member']['SUBJECTPASSWORDRESET'] = array(
'Your password reset link',
PR_MEDIUM,
'Email subject'
);
$lang['en_US']['Member']['EMAILPASSWORDINTRO'] = 'Here\'s your new password';
$lang['en_US']['Member']['EMAILPASSWORDAPPENDIX'] = 'Your password has been changed. Please keep this email, for future reference.';
$lang['en_US']['Member']['VALIDATIONMEMBEREXISTS'] = 'There already exists a member with this email';
$lang['en_US']['Member']['ERRORWRONGCRED'] = 'That doesn\'t seem to be the right e-mail address or password. Please try again.';
$lang['en_US']['MemberAuthenticator']['TITLE'] = 'E-mail &amp; Password';
$lang['en_US']['Member']['BUTTONLOGINOTHER'] = 'Log in as someone else';
$lang['en_US']['Member']['REMEMBERME'] = 'Remember me next time?';
$lang['en_US']['Member']['BUTTONLOGIN'] = 'Log in';
$lang['en_US']['Member']['BUTTONLOSTPASSWORD'] = 'I\'ve lost my password';
$lang['en_US']['Member']['LOGGEDINAS'] = 'You\'re logged in as %s.';
$lang['en_US']['Member']['WELCOMEBACK'] = 'Welcome Back, %s';
$lang['en_US']['Security']['OPENIDHEADER'] = 'OpenID/i-name credentials';
$lang['en_US']['Security']['OPENIDDESC'] = '<p>Make sure you enter your normalized OpenID/i-name credentials
here, i.e. with protocol and trailing slash for OpenID (e.g. http://openid.silverstripe.com/).</p>';
$lang['en_US']['Security']['OPENIDURL'] = 'OpenID URL/i-name';
$lang['en_US']['Security']['MEMBERALREADYEXISTS'] = 'There already exists a member with this identity URL';
$lang['en_US']['OpenIDAuthenticator']['ERRORCRED'] = 'Please enter your OpenID URL or your i-name.';
$lang['en_US']['OpenIDAuthenticator']['TRANSACTIONINPROGRESS'] = 'OpenID transaction in progress';
$lang['en_US']['OpenIDAuthenticator']['VERIFICATIONCANCELLED'] = 'The verification was cancelled. Please try again.';
$lang['en_US']['OpenIDAuthenticator']['AUTHFAILED'] = 'The OpenID/i-name authentication failed.';
$lang['en_US']['OpenIDAuthenticator']['LOGINFAILED'] = 'Login failed. Please try again.';
$lang['en_US']['OpenIDLoginForm']['DESC'] = '<div id="OpenIDDescription"><p>OpenID is an Internet-wide identity system
that allows you to sign in to many websites with a single account.
For more information visit <a href="http://openid.net">openid.net</a>.</p></div>
';
$lang['en_US']['OpenIDLoginForm']['URL'] = 'OpenID URL';
$lang['en_US']['Security']['NOTEPAGESECURED'] = 'That page is secured. Enter your credentials below and we will send you right along.';
$lang['en_US']['Security']['ALREADYLOGGEDIN'] = 'You don\'t have access to this page. If you have another account that can access that page, you can log in below.';
$lang['en_US']['Security']['LOGGEDOUT'] = 'You have been logged out. If you would like to log in again, enter your credentials below.';
$lang['en_US']['Security']['LOSTPASSWORDHEADER'] = 'Lost Password';
$lang['en_US']['Security']['NOTERESETPASSWORD'] = 'Enter your e-mail address and we will send you a link with which you can reset your password';
$lang['en_US']['Security']['BUTTONSEND'] = 'Send me the password reset link';
$lang['en_US']['Security']['PASSWORDSENTHEADER'] = 'Password reset link sent to \'%s\'';
$lang['en_US']['Security']['PASSWORDSENTTEXT'] = 'Thank you! The password reset link has been sent to \'%s\'.';
$lang['en_US']['Security']['CHANGEPASSWORDHEADER'] = 'Change your password';
$lang['en_US']['Security']['ENTERNEWPASSWORD'] = 'Please enter a new password.';
$lang['en_US']['Security']['CHANGEPASSWORDBELOW'] = 'You can change your password below.';
$lang['en_US']['Security']['ERRORPASSWORDPERMISSION'] = 'You must be logged in in order to change your password!';
$lang['en_US']['ComplexTableField.ss']['SORTASC'] = 'Sort ascending';
$lang['en_US']['ComplexTableField.ss']['SORTDESC'] = 'Sort descending';
$lang['en_US']['ComplexTableField.ss']['ADDITEM'] = array(
'Add',
PR_MEDIUM,
'Add [name]'
);
$lang['en_US']['ComplexTableField.ss']['SHOW'] = 'show';
$lang['en_US']['ComplexTableField.ss']['EDIT'] = 'edit';
$lang['en_US']['ComplexTableField.ss']['DELETEROW'] = 'Delete this row';
$lang['en_US']['ComplexTableField.ss']['DELETE'] = 'delete';
$lang['en_US']['ComplexTableField.ss']['NOITEMSFOUND'] = 'No items found';
$lang['en_US']['ComplexTableField_popup.ss']['PREVIOUS'] = 'Previous';
$lang['en_US']['ComplexTableField_popup.ss']['NEXT'] = 'Next';
$lang['en_US']['Image_iframe.ss']['TITLE'] = 'Image Uploading Iframe';
$lang['en_US']['TableField.ss']['CSVEXPORT'] = 'Export to CSV';
$lang['en_US']['ToggleCompositeField.ss']['SHOW'] = 'Show';
$lang['en_US']['ToggleCompositeField.ss']['HIDE'] = 'Hide';
$lang['en_US']['ChangePasswordEmail.ss']['HELLO'] = 'Hi';
$lang['en_US']['ChangePasswordEmail.ss']['CHANGEPASSWORDTEXT1'] = array(
'You changed your password for',
PR_MEDIUM,
'for a url'
);
$lang['en_US']['ChangePasswordEmail.ss']['CHANGEPASSWORDTEXT2'] = 'You can now use the following credentials to log in:';
$lang['en_US']['ForgotPasswordEmail.ss']['HELLO'] = 'Hi';
?> ?>

View File

@ -25,9 +25,9 @@ class BasicAuth extends Object {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
if(isset($_SERVER['PHP_AUTH_USER'])) { if(isset($_SERVER['PHP_AUTH_USER'])) {
echo "That username / password isn't recognised"; echo _t('BasicAuth.ERRORNOTREC', "That username / password isn't recognised");
} else { } else {
echo "Please enter a username and password."; echo _t('BasicAuth.ENTERINFO', "Please enter a username and password.");
} }
die(); die();
@ -38,7 +38,7 @@ class BasicAuth extends Object {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
if(isset($_SERVER['PHP_AUTH_USER'])) { if(isset($_SERVER['PHP_AUTH_USER'])) {
echo "That user is not an administrator."; echo _t('BasicAuth.ERRORNOTADMIN', "That user is not an administrator.");
} }
die(); die();

View File

@ -27,15 +27,15 @@ class ChangePasswordForm extends Form {
if(!$fields) { if(!$fields) {
$fields = new FieldSet(); $fields = new FieldSet();
if(Member::currentUser()) { if(Member::currentUser()) {
$fields->push(new EncryptField("OldPassword","Your old password")); $fields->push(new EncryptField("OldPassword",_t('Member.YOUROLDPASSWORD', "Your old password")));
} }
$fields->push(new EncryptField("NewPassword1", "New Password")); $fields->push(new EncryptField("NewPassword1", _t('Member.NEWPASSWORD', "New Password")));
$fields->push(new EncryptField("NewPassword2", "Confirm New Password")); $fields->push(new EncryptField("NewPassword2", _t('Member.CONFIRMNEWPASSWORD', "Confirm New Password")));
} }
if(!$actions) { if(!$actions) {
$actions = new FieldSet( $actions = new FieldSet(
new FormAction("changePassword", "Change Password") new FormAction("changePassword", _t('Member.BUTTONCHANGEPASSWORD', "Change Password"))
); );
} }
@ -54,7 +54,9 @@ class ChangePasswordForm extends Form {
if($member->checkPassword($data['OldPassword']) == false) { if($member->checkPassword($data['OldPassword']) == false) {
$this->clearMessage(); $this->clearMessage();
$this->sessionMessage( $this->sessionMessage(
"Your current password does not match, please try again", "bad"); _t('Member.ERRORPASSWORDNOTMATCH', "Your current password does not match, please try again"),
"bad"
);
Director::redirectBack(); Director::redirectBack();
} }
} }
@ -82,7 +84,7 @@ class ChangePasswordForm extends Form {
$this->clearMessage(); $this->clearMessage();
$this->sessionMessage( $this->sessionMessage(
"Your password has been changed, and a copy emailed to you.", _t('Member.PASSWORDCHANGED', "Your password has been changed, and a copy emailed to you."),
"good"); "good");
Session::clear('AutoLoginHash'); Session::clear('AutoLoginHash');
Director::redirect(Security::Link('login')); Director::redirect(Security::Link('login'));
@ -90,7 +92,7 @@ class ChangePasswordForm extends Form {
} else { } else {
$this->clearMessage(); $this->clearMessage();
$this->sessionMessage( $this->sessionMessage(
"Your have entered your new password differently, try again", _t('Member.ERRORNEWPASSWORD', "Your have entered your new password differently, try again"),
"bad"); "bad");
Director::redirectBack(); Director::redirectBack();
} }

View File

@ -238,10 +238,10 @@ class Member extends DataObject {
*/ */
function getMemberFormFields() { function getMemberFormFields() {
return new FieldSet( return new FieldSet(
new TextField("FirstName", "First Name"), new TextField("FirstName", _t('Member.FIRSTNAME', 'First Name')),
new TextField("Surname", "Surname"), new TextField("Surname", _t('Member.SURNAME', "Surname")),
new TextField("Email", "Email"), new TextField("Email", _t('Member.EMAIL', "Email", PR_MEDIUM, 'Noun')),
new TextField("Password", "Password") new TextField("Password", _t('Member.PASSWORD', 'Password'))
); );
} }
@ -708,13 +708,18 @@ class Member extends DataObject {
$fields = new FieldSet( $fields = new FieldSet(
//new TextField("Salutation", "Title"), //new TextField("Salutation", "Title"),
new HeaderField( "Personal Details" ), new HeaderField(_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')),
new TextField("FirstName", "First Name"), new TextField("FirstName", _t('Member.FIRSTNAME')),
new TextField("Surname", "Surname"), new TextField("Surname", _t('Member.SURNAME')),
new HeaderField( "User Details" ), new HeaderField(_t('Member.USERDETAILS', "User Details", PR_MEDIUM, 'Headline for formfields')),
new TextField("Email", "Email"), new TextField("Email", _t('Member.EMAIL')),
new DropdownField("Locale", "Interface Language", i18n::get_existing_translations(), $locale), new DropdownField(
new PasswordField("Password", "Password") "Locale",
_t('Member.INTERFACELANG', "Interface Language", PR_MEDIUM, 'Language of the CMS'),
i18n::get_existing_translations(),
$locale
),
new PasswordField("Password", _t('Member.PASSWORD'))
//new TextareaField("Address","Address"), //new TextareaField("Address","Address"),
//new TextField("JobTitle", "Job Title"), //new TextField("JobTitle", "Job Title"),
//new TextField( "Organisation", "Organisation" ), //new TextField( "Organisation", "Organisation" ),
@ -1043,48 +1048,45 @@ class Member_ProfileForm extends Form {
* Class used as template to send an email to new members * Class used as template to send an email to new members
*/ */
class Member_SignupEmail extends Email_Template { class Member_SignupEmail extends Email_Template {
protected protected $from = ''; // setting a blank from address uses the site's default administrator email
$from = '', // setting a blank from address uses the site's default administrator email protected $to = '$Email';
$to = '$Email', protected $subject = '';
$subject = "Thanks for signing up", protected $body = '';
$body = '
<h1>Welcome, $FirstName.</h1>
<p>Thanks for signing up to become a new member, your details are listed below for future reference.</p>
<p>You can login to the website using the credentials listed below: function __construct() {
$this->subject = _t('Member.EMAILSIGNUPSUBJECT', "Thanks for signing up");
$this->body = '
<h1>' . _t('WELCOME','Welcome') . ', $FirstName.</h1>
<p>' . _t('Member.EMAILSIGNUPINTRO1','Thanks for signing up to become a new member, your details are listed below for future reference.') . '</p>
<p>' . _t('Member.EMAILSIGNUPINTRO2','You can login to the website using the credentials listed below') . ':
<ul> <ul>
<li><strong>Email:</strong>$Email</li> <li><strong>' . _t('Member.EMAIL') . '</strong>$Email</li>
<li><strong>Password:</strong>$Password</li> <li><strong>' . _t('Member.PASSWORD') . ':</strong>$Password</li>
</ul> </ul>
</p> </p>
<h3>Contact Information</h3> <h3>' . _t('Member.CONTACTINFO','Contact Information') . '</h3>
<ul> <ul>
<li><strong>Name:</strong> $FirstName $Surname</li> <li><strong>' . _t('Member.NAME','Name') . ':</strong> $FirstName $Surname</li>
<% if Phone %> <% if Phone %>
<li><strong>Phone:</strong> $Phone</li> <li><strong>' . _t('Member.PHONE','Phone') . ':</strong> $Phone</li>
<% end_if %> <% end_if %>
<% if Mobile %> <% if Mobile %>
<li><strong>Mobile:</strong> $Mobile</li> <li><strong>' . _t('Member.MOBILE','Mobile') . ':</strong> $Mobile</li>
<% end_if %> <% end_if %>
<% if RuralAddressCheck %> <li><strong>' . _t('Member.ADDRESS','Address') . ':</strong>
<li><strong>Rural Address:</strong> <br/>
$RapidResponse $Road<br/> $Number $Street $StreetType<br/>
$RDNumber<br/> $Suburb<br/>
$City $Postcode $City $Postcode
</li> </li>
<% else %>
<li><strong>Address:</strong>
<br/>
$Number $Street $StreetType<br/>
$Suburb<br/>
$City $Postcode
</li>
<% end_if %>
</ul>'; </ul>
';
}
function MemberData() { function MemberData() {
return $this->template_data->listOfFields( return $this->template_data->listOfFields(
@ -1103,9 +1105,13 @@ class Member_SignupEmail extends Email_Template {
*/ */
class Member_ChangePasswordEmail extends Email_Template { class Member_ChangePasswordEmail extends Email_Template {
protected $from = ''; // setting a blank from address uses the site's default administrator email protected $from = ''; // setting a blank from address uses the site's default administrator email
protected $subject = "Your password has been changed"; protected $subject = '';
protected $ss_template = 'ChangePasswordEmail'; protected $ss_template = 'ChangePasswordEmail';
protected $to = '$Email'; protected $to = '$Email';
function __construct() {
$this->subject = _t('Member.SUBJECTPASSWORDCHANGED', "Your password has been changed", PR_MEDIUM, 'Email subject');
}
} }
@ -1115,9 +1121,13 @@ class Member_ChangePasswordEmail extends Email_Template {
*/ */
class Member_ForgotPasswordEmail extends Email_Template { class Member_ForgotPasswordEmail extends Email_Template {
protected $from = ''; // setting a blank from address uses the site's default administrator email protected $from = ''; // setting a blank from address uses the site's default administrator email
protected $subject = "Your password reset link"; protected $subject = '';
protected $ss_template = 'ForgotPasswordEmail'; protected $ss_template = 'ForgotPasswordEmail';
protected $to = '$Email'; protected $to = '$Email';
function __construct() {
$this->subject = _t('Member.SUBJECTPASSWORDRESET', "Your password reset link", PR_MEDIUM, 'Email subject');
}
} }
@ -1160,14 +1170,20 @@ class Member_UnsubscribeRecord extends DataObject {
protected protected
$from = '', // setting a blank from address uses the site's default administrator email $from = '', // setting a blank from address uses the site's default administrator email
$to = '$Email', $to = '$Email',
$subject = "Your password has been changed", $subject = '',
$body = ' $body = '';
<h1>Here\'s your new password</h1>
<p> function __construct() {
<strong>Email:</strong> $Email<br /> $this->subject = _t('Member.SUBJECTPASSWORDCHANGED');
<strong>Password:</strong> $Password
</p> $this->body = '
<p>Your password has been changed. Please keep this email, for future reference.</p>'; <h1>' . _t('Member.EMAILPASSWORDINTRO', "Here's your new password") . '</h1>
<p>
<strong>' . _t('Member.EMAIL') . ':</strong> $Email<br />
<strong>' . _t('Member.PASSWORD') . ':</strong> $Password
</p>
<p>' . _t('Member.EMAILPASSWORDAPPENDIX', 'Your password has been changed. Please keep this email, for future reference.') . '</p>';
}
} }
@ -1219,8 +1235,8 @@ class Member_Validator extends RequiredFields {
if(is_object($member) && $member->ID != $id) { if(is_object($member) && $member->ID != $id) {
$emailField = $this->form->dataFieldByName('Email'); $emailField = $this->form->dataFieldByName('Email');
$this->validationError($emailField->id(), $this->validationError($emailField->id(),
"There already exists a member with this email", _t('Member.VALIDATIONMEMBEREXISTS', "There already exists a member with this email"),
"required"); "required");
$valid = false; $valid = false;
} }

View File

@ -40,11 +40,12 @@ class MemberAuthenticator extends Authenticator {
} }
if($member) { if($member) {
Session::clear("BackURL"); Session::clear("BackURL");
} else if(!is_null($form)) { } else if(!is_null($form)) {
$form->sessionMessage( $form->sessionMessage(
"That doesn't seem to be the right e-mail address or password. Please try again.", _t('Member.ERRORWRONGCRED', "That doesn't seem to be the right e-mail address or password. Please try again."),
"bad"); "bad"
);
} }
return $member; return $member;
@ -70,7 +71,7 @@ class MemberAuthenticator extends Authenticator {
* @return string Returns the name of the authentication method. * @return string Returns the name of the authentication method.
*/ */
public static function get_name() { public static function get_name() {
return "E-mail &amp; Password"; return _t('MemberAuthenticator.TITLE', "E-mail &amp; Password");
} }
} }

View File

@ -46,24 +46,22 @@ class MemberLoginForm extends LoginForm {
if($checkCurrentUser && Member::currentUserID()) { if($checkCurrentUser && Member::currentUserID()) {
$fields = new FieldSet(); $fields = new FieldSet();
$actions = new FieldSet(new FormAction("logout", $actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")));
"Log in as someone else"));
} else { } else {
if(!$fields) { if(!$fields) {
$fields = new FieldSet( $fields = new FieldSet(
new HiddenField("AuthenticationMethod", null, new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this),
$this->authenticator_class, $this), new TextField("Email", _t('Member.EMAIL'),
new TextField("Email", "E-mail address",
Session::get('SessionForms.MemberLoginForm.Email'), null, $this), Session::get('SessionForms.MemberLoginForm.Email'), null, $this),
new EncryptField("Password", "Password", null, $this), new EncryptField("Password", _t('Member.PASSWORD'), null, $this),
new CheckboxField("Remember", "Remember me next time?", new CheckboxField("Remember", _t('Member.REMEMBERME', "Remember me next time?"),
Session::get('SessionForms.MemberLoginForm.Remember'), $this) Session::get('SessionForms.MemberLoginForm.Remember'), $this)
); );
} }
if(!$actions) { if(!$actions) {
$actions = new FieldSet( $actions = new FieldSet(
new FormAction("dologin", "Log in"), new FormAction("dologin", _t('Member.BUTTONLOGIN', "Log in")),
new FormAction("forgotPassword", "I've lost my password") new FormAction("forgotPassword", _t('Member.BUTTONLOSTPASSWORD', "I've lost my password"))
); );
} }
} }
@ -83,7 +81,7 @@ class MemberLoginForm extends LoginForm {
parent::getMessageFromSession(); parent::getMessageFromSession();
if(($member = Member::currentUser()) && if(($member = Member::currentUser()) &&
!Session::get('MemberLoginForm.force_message')) { !Session::get('MemberLoginForm.force_message')) {
$this->message = "You're logged in as $member->FirstName."; $this->message = sprintf(_t('Member.LOGGEDINAS', "You're logged in as %s."), $member->FirstName);
} }
Session::set('MemberLoginForm.force_message', false); Session::set('MemberLoginForm.force_message', false);
} }
@ -146,7 +144,9 @@ class MemberLoginForm extends LoginForm {
public function performLogin($data) { public function performLogin($data) {
if($member = MemberAuthenticator::authenticate($data, $this)) { if($member = MemberAuthenticator::authenticate($data, $this)) {
$firstname = Convert::raw2xml($member->FirstName); $firstname = Convert::raw2xml($member->FirstName);
Session::set("Security.Message.message", "Welcome Back, {$firstname}"); Session::set("Security.Message.message",
sprintf(_t('Member.WELCOMEBACK', "Welcome Back, %s"), $firstname)
);
Session::set("Security.Message.type", "good"); Session::set("Security.Message.type", "good");
$member->LogIn(isset($data['Remember'])); $member->LogIn(isset($data['Remember']));
@ -180,8 +180,8 @@ class MemberLoginForm extends LoginForm {
} else if($data['Email']) { } else if($data['Email']) {
$this->sessionMessage( $this->sessionMessage(
"Sorry, but I don't recognise the e-mail address. Maybe you need " . _t('Member.ERRORSIGNUP', "Sorry, but I don't recognise the e-mail address. Maybe you need " .
"to sign up, or perhaps you used another e-mail address?", "to sign up, or perhaps you used another e-mail address?"),
"bad"); "bad");
Director::redirectBack(); Director::redirectBack();

View File

@ -64,13 +64,20 @@ class OpenIDAuthenticatedRole extends DataObjectDecorator {
* to edit the new database fields. * to edit the new database fields.
*/ */
function updateCMSFields(FieldSet &$fields) { function updateCMSFields(FieldSet &$fields) {
$fields->push(new HeaderField("OpenID/i-name credentials"), "OpenIDHeader"); $fields->push(
$fields->push(new LiteralField("OpenIDDescription", new HeaderField(_t('Security.OPENIDHEADER', "OpenID/i-name credentials")),
"<p>Make sure you enter your normalized OpenID/i-name credentials " . "OpenIDHeader"
"here, i.e. with protocol and trailing slash for OpenID (e.g. " . );
"http://openid.silverstripe.com/).</p>")); $fields->push(
$fields->push(new TextField("IdentityURL", "OpenID URL/i-name"), new LiteralField("OpenIDDescription",
"IdentityURL"); _t('Security.OPENIDDESC',"<p>Make sure you enter your normalized OpenID/i-name credentials
here, i.e. with protocol and trailing slash for OpenID (e.g. http://openid.silverstripe.com/).</p>")
)
);
$fields->push(
new TextField("IdentityURL", _t('Security.OPENIDURL', "OpenID URL/i-name")),
"IdentityURL"
);
} }
@ -132,7 +139,7 @@ class OpenIDAuthenticatedRole_Validator extends Extension {
if(is_object($member) && $member->ID != $id) { if(is_object($member) && $member->ID != $id) {
$field = $form->dataFieldByName('IdentityURL'); $field = $form->dataFieldByName('IdentityURL');
$this->owner->validationError($field->id(), $this->owner->validationError($field->id(),
"There already exists a member with this identity URL", _t('Security.MEMBERALREADYEXISTS', "There already exists a member with this identity URL"),
"required"); "required");
return false; return false;
} }

View File

@ -81,8 +81,10 @@ class OpenIDAuthenticator extends Authenticator {
if(strlen($openid) == 0) { if(strlen($openid) == 0) {
if(!is_null($form)) { if(!is_null($form)) {
$form->sessionMessage("Please enter your OpenID URL or your i-name.", $form->sessionMessage(
"bad"); _t('OpenIDAuthenticator.ERRORCRED', "Please enter your OpenID URL or your i-name."),
"bad"
);
} }
return false; return false;
} }
@ -99,9 +101,13 @@ class OpenIDAuthenticator extends Authenticator {
$auth_request = $consumer->begin($openid); $auth_request = $consumer->begin($openid);
if(!$auth_request) { if(!$auth_request) {
if(!is_null($form)) { if(!is_null($form)) {
$form->sessionMessage("That doesn't seem to be a valid OpenID " . $form->sessionMessage(
"or i-name identifier. Please try again.", _t('OpenIDAuthenticator.ERRORNOVALID',
"bad"); "That doesn't seem to be a valid OpenID " .
"or i-name identifier. Please try again."
),
"bad"
);
} }
return false; return false;
} }
@ -110,11 +116,14 @@ class OpenIDAuthenticator extends Authenticator {
if(!($member = DataObject::get_one("Member", if(!($member = DataObject::get_one("Member",
"Member.IdentityURL = '$SQL_identity'"))) { "Member.IdentityURL = '$SQL_identity'"))) {
if(!is_null($form)) { if(!is_null($form)) {
$form->sessionMessage("Either your account is not enabled for " . $form->sessionMessage(
"OpenID/i-name authentication " . _t('OpenIDAuthenticator.ERRORNOTENABLED',
"or the entered identifier is wrong. " . "Either your account is not enabled for " .
"Please try again.", "OpenID/i-name authentication " .
"bad"); "or the entered identifier is wrong. " .
"Please try again."),
"bad"
);
} }
return false; return false;
} }
@ -147,13 +156,15 @@ class OpenIDAuthenticator extends Authenticator {
} else { } else {
$page_contents = array( $page_contents = array(
"<html><head><title>", "<html><head><title>",
"OpenID transaction in progress", _t('OpenIDAuthenticator.TRANSACTIONINPROGRESS', "OpenID transaction in progress"),
"</title></head>", "</title></head>",
"<body onload='document.getElementById(\"". $form_id . "<body onload='document.getElementById(\"". $form_id .
"\").submit()'>", "\").submit()'>",
$form_html, $form_html,
"<p>Click &quot;Continue&quot; to login. You are only seeing " . _t('OpenIDAuthenticator.TRANSACTIONNOTE',
"this because you appear to have JavaScript disabled.</p>", "<p>Click &quot;Continue&quot; to login. You are only seeing " .
"this because you appear to have JavaScript disabled.</p>"
),
"</body></html>"); "</body></html>");
print implode("\n", $page_contents); print implode("\n", $page_contents);
@ -224,7 +235,7 @@ class OpenIDAuthenticator_Controller extends Controller {
if($response->status == Auth_OpenID_CANCEL) { if($response->status == Auth_OpenID_CANCEL) {
Session::set("Security.Message.message", Session::set("Security.Message.message",
"The verification was cancelled. Please try again."); _t('OpenIDAuthenticator.VERIFICATIONCANCELLED', "The verification was cancelled. Please try again."));
Session::set("Security.Message.type", "bad"); Session::set("Security.Message.type", "bad");
if(isset($_GET['debug_profile'])) if(isset($_GET['debug_profile']))
@ -234,7 +245,8 @@ class OpenIDAuthenticator_Controller extends Controller {
} else if($response->status == Auth_OpenID_FAILURE) { } else if($response->status == Auth_OpenID_FAILURE) {
Session::set("Security.Message.message", // use $response->message ?? Session::set("Security.Message.message", // use $response->message ??
"The OpenID/i-name authentication failed."); _t('OpenIDAuthenticator.AUTHFAILED', "The OpenID/i-name authentication failed.")
);
Session::set("Security.Message.type", "bad"); Session::set("Security.Message.type", "bad");
if(isset($_GET['debug_profile'])) if(isset($_GET['debug_profile']))
@ -259,7 +271,8 @@ class OpenIDAuthenticator_Controller extends Controller {
"Member.IdentityURL = '$SQL_identity'")) { "Member.IdentityURL = '$SQL_identity'")) {
$firstname = Convert::raw2xml($member->FirstName); $firstname = Convert::raw2xml($member->FirstName);
Session::set("Security.Message.message", Session::set("Security.Message.message",
"Welcome Back, {$firstname}"); sprintf(_t('Member.WELCOMEBACK'), $firstname)
);
Session::set("Security.Message.type", "good"); Session::set("Security.Message.type", "good");
$member->LogIn( $member->LogIn(
@ -277,7 +290,8 @@ class OpenIDAuthenticator_Controller extends Controller {
} else { } else {
Session::set("Security.Message.message", Session::set("Security.Message.message",
"Login failed. Please try again."); _t('OpenIDAuthenticator.LOGINFAILED', "Login failed. Please try again.")
);
Session::set("Security.Message.type", "bad"); Session::set("Security.Message.type", "bad");
if($badLoginURL = Session::get("BadLoginURL")) { if($badLoginURL = Session::get("BadLoginURL")) {

View File

@ -47,26 +47,28 @@ class OpenIDLoginForm extends LoginForm {
if($checkCurrentUser && Member::currentUserID()) { if($checkCurrentUser && Member::currentUserID()) {
$fields = new FieldSet(); $fields = new FieldSet();
$actions = new FieldSet(new FormAction("logout", $actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER')));
"Log in as someone else"));
} else { } else {
if(!$fields) { if(!$fields) {
$fields = new FieldSet( $fields = new FieldSet(
new LiteralField("OpenIDDescription", ' new LiteralField("OpenIDDescription",
<div id="OpenIDDescription"><p>OpenID is an Internet-wide identity system _t('OpenIDLoginForm.DESC',
that allows you to sign in to many websites with a single account. '<div id="OpenIDDescription"><p>OpenID is an Internet-wide identity system
For more information visit <a href="http://openid.net">openid.net</a>.</p></div>'), that allows you to sign in to many websites with a single account.
For more information visit <a href="http://openid.net">openid.net</a>.</p></div>
')
),
new HiddenField("AuthenticationMethod", null, new HiddenField("AuthenticationMethod", null,
$this->authenticator_class, $this), $this->authenticator_class, $this),
new TextField("OpenIDURL", "OpenID URL", new TextField("OpenIDURL", _t('OpenIDLoginForm.URL', "OpenID URL"),
Session::get('SessionForms.OpenIDLoginForm.OpenIDURL'), null, $this), Session::get('SessionForms.OpenIDLoginForm.OpenIDURL'), null, $this),
new CheckboxField("Remember", "Remember me next time?", new CheckboxField("Remember", _t('Member.REMEMBERME'),
Session::get('SessionForms.OpenIDLoginForm.Remember'), $this) Session::get('SessionForms.OpenIDLoginForm.Remember'), $this)
); );
} }
if(!$actions) { if(!$actions) {
$actions = new FieldSet( $actions = new FieldSet(
new FormAction("dologin", "Log in") new FormAction("dologin", _t('Member.BUTTONLOGIN'))
); );
} }
} }
@ -86,7 +88,7 @@ class OpenIDLoginForm extends LoginForm {
parent::getMessageFromSession(); parent::getMessageFromSession();
if(($member = Member::currentUser()) && if(($member = Member::currentUser()) &&
!Session::get('OpenIDLoginForm.force_message')) { !Session::get('OpenIDLoginForm.force_message')) {
$this->message = "You're logged in as $member->FirstName."; $this->message = sprintf(_t('Member.LOGGEDINAS'), $member->FirstName);
} }
Session::set('OpenIDLoginForm.force_message', false); Session::set('OpenIDLoginForm.force_message', false);
} }

View File

@ -103,9 +103,18 @@ class Security extends Controller {
// Prepare the messageSet provided // Prepare the messageSet provided
if(!$messageSet) { if(!$messageSet) {
$messageSet = array( $messageSet = array(
'default' => "That page is secured. Enter your credentials below and we will send you right along.", 'default' => _t(
'alreadyLoggedIn' => "You don't have access to this page. If you have another account that can access that page, you can log in below.", 'Security.NOTEPAGESECURED',
'logInAgain' => "You have been logged out. If you would like to log in again, enter your credentials below.", "That page is secured. Enter your credentials below and we will send you right along."
),
'alreadyLoggedIn' => _t(
'Security.ALREADYLOGGEDIN',
"You don't have access to this page. If you have another account that can access that page, you can log in below."
),
'logInAgain' => _t(
'Security.LOGGEDOUT',
"You have been logged out. If you would like to log in again, enter your credentials below."
),
); );
} else if(!is_array($messageSet)) { } else if(!is_array($messageSet)) {
$messageSet = array('default' => $messageSet); $messageSet = array('default' => $messageSet);
@ -315,14 +324,18 @@ class Security extends Controller {
Requirements::javascript('jsparty/scriptaculous/effects.js'); Requirements::javascript('jsparty/scriptaculous/effects.js');
$tmpPage = new Page(); $tmpPage = new Page();
$tmpPage->Title = 'Lost Password'; $tmpPage->Title = _t('Security.LOSTPASSWORDHEADER', 'Lost Password');
$tmpPage->URLSegment = 'Security'; $tmpPage->URLSegment = 'Security';
$controller = new Page_Controller($tmpPage); $controller = new Page_Controller($tmpPage);
$customisedController = $controller->customise(array( $customisedController = $controller->customise(array(
'Content' => 'Content' =>
'<p>Enter your e-mail address and we will send you a link with ' . '<p>' .
'which you can reset your password</p>', _t(
'Security.NOTERESETPASSWORD',
'Enter your e-mail address and we will send you a link with which you can reset your password'
) .
'</p>',
'Form' => $this->LostPasswordForm(), 'Form' => $this->LostPasswordForm(),
)); ));
@ -338,9 +351,11 @@ class Security extends Controller {
*/ */
public function LostPasswordForm() { public function LostPasswordForm() {
return new MemberLoginForm($this, 'LostPasswordForm', return new MemberLoginForm($this, 'LostPasswordForm',
new FieldSet(new EmailField('Email', 'E-mail address')), new FieldSet(new EmailField('Email', _t('Member.EMAIL'))),
new FieldSet(new FormAction('forgotPassword', new FieldSet(new FormAction(
'Send me the password reset link')), 'forgotPassword',
_t('Security.BUTTONSEND', 'Send me the password reset link')
)),
false); false);
} }
@ -358,15 +373,17 @@ class Security extends Controller {
Requirements::javascript('jsparty/scriptaculous/effects.js'); Requirements::javascript('jsparty/scriptaculous/effects.js');
$tmpPage = new Page(); $tmpPage = new Page();
$tmpPage->Title = 'Lost Password'; $tmpPage->Title = _t('Security.LOSTPASSWORDHEADER');
$tmpPage->URLSegment = 'Security'; $tmpPage->URLSegment = 'Security';
$controller = new Page_Controller($tmpPage); $controller = new Page_Controller($tmpPage);
$email = Convert::raw2xml($this->urlParams['ID']); $email = Convert::raw2xml($this->urlParams['ID']);
$customisedController = $controller->customise(array( $customisedController = $controller->customise(array(
'Title' => "Password reset link sent to '$email'", 'Title' => sprintf(_t('Security.PASSWORDSENTHEADER', "Password reset link sent to '%s'"), $email),
'Content' => 'Content' =>
"<p>Thank you! The password reset link has been sent to '$email'.</p>", "<p>" .
sprintf(_t('Security.PASSWORDSENTTEXT', "Thank you! The password reset link has been sent to '%s'."), $email) .
"</p>",
)); ));
//Controller::$currentController = $controller; //Controller::$currentController = $controller;
@ -391,7 +408,7 @@ class Security extends Controller {
*/ */
public function changepassword() { public function changepassword() {
$tmpPage = new Page(); $tmpPage = new Page();
$tmpPage->Title = 'Change your password'; $tmpPage->Title = _t('Security.CHANGEPASSWORDHEADER', 'Change your password');
$tmpPage->URLSegment = 'Security'; $tmpPage->URLSegment = 'Security';
$controller = new Page_Controller($tmpPage); $controller = new Page_Controller($tmpPage);
@ -401,29 +418,39 @@ class Security extends Controller {
$customisedController = $controller->customise(array( $customisedController = $controller->customise(array(
'Content' => 'Content' =>
'<p>Please enter a new password.</p>', '<p>' .
_t('Security.ENTERNEWPASSWORD', 'Please enter a new password.') .
'</p>',
'Form' => $this->ChangePasswordForm(), 'Form' => $this->ChangePasswordForm(),
)); ));
} elseif(Member::currentUser()) { } elseif(Member::currentUser()) {
// let a logged in user change his password // let a logged in user change his password
$customisedController = $controller->customise(array( $customisedController = $controller->customise(array(
'Content' => '<p>You can change your password below.</p>', 'Content' => '<p>' . _t('Security.CHANGEPASSWORDBELOW', 'You can change your password below.') . '</p>',
'Form' => $this->ChangePasswordForm())); 'Form' => $this->ChangePasswordForm()));
} else { } else {
// show an error message if the auto login hash is invalid and the // show an error message if the auto login hash is invalid and the
// user is not logged in // user is not logged in
if(isset($_REQUEST['h'])) { if(isset($_REQUEST['h'])) {
$customisedController = $controller->customise(array('Content' => $customisedController = $controller->customise(
"<p>The password reset link is invalid or expired.</p>\n" . array('Content' =>
'<p>You can request a new one <a href="' . sprintf(
$this->Link('lostpassword') . _t('Security.NOTERESETLINKINVALID',
'">here</a> or change your password after you <a href="' . "<p>The password reset link is invalid or expired.</p>\n" .
$this->link('login') . '">logged in</a>.</p>')); '<p>You can request a new one <a href="%s">here</a> or change your password after you <a href="%s">logged in</a>.</p>'
),
$this->Link('lostpassword'),
$this->link('login')
)
)
);
} else { } else {
self::permissionFailure($this, self::permissionFailure(
'You must be logged in in order to change your password!'); $this,
_t('Security.ERRORPASSWORDPERMISSION', 'You must be logged in in order to change your password!')
);
return; return;
} }
} }

View File

@ -13,9 +13,9 @@
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>"> <span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
<a href="$SortLink""> <a href="$SortLink"">
<% if SortDirection = desc %> <% if SortDirection = desc %>
<img src="cms/images/bullet_arrow_up.png" alt="Sort ascending" /> <img src="cms/images/bullet_arrow_up.png" alt="<% _t('SORTASC', 'Sort ascending') %>" />
<% else %> <% else %>
<img src="cms/images/bullet_arrow_down.png" alt="Sort descending" /> <img src="cms/images/bullet_arrow_down.png" alt="<% _t('SORTDESC', 'Sort descending') %>" />
<% end_if %> <% end_if %>
</a> </a>
&nbsp; &nbsp;
@ -47,7 +47,7 @@
<tr> <tr>
<% if Markable %><td width="18">&nbsp;</td><% end_if %> <% if Markable %><td width="18">&nbsp;</td><% end_if %>
<td colspan="$ItemCount"> <td colspan="$ItemCount">
<a class="popuplink addlink" href="$AddLink" alt="add"><img src="cms/images/add.gif" alt="add" />Add $Title</a> <a class="popuplink addlink" href="$AddLink" alt="add"><img src="cms/images/add.gif" alt="add" /><% _t('ADDITEM', 'Add', PR_MEDIUM, 'Add [name]') %> $Title</a>
</td> </td>
<% if Can(show) %><td width="18">&nbsp;</td><% end_if %> <% if Can(show) %><td width="18">&nbsp;</td><% end_if %>
<% if Can(edit) %><td width="18">&nbsp;</td><% end_if %> <% if Can(edit) %><td width="18">&nbsp;</td><% end_if %>
@ -64,20 +64,20 @@
<td>$Value</td> <td>$Value</td>
<% end_control %> <% end_control %>
<% if Can(show) %> <% if Can(show) %>
<td width="18"><a class="popuplink showlink" href="$ShowLink" target="_blank"><img src="cms/images/show.png" alt="show" /></a></td> <td width="18"><a class="popuplink showlink" href="$ShowLink" target="_blank"><img src="cms/images/show.png" alt="<% _t('SHOW', 'show') %>" /></a></td>
<% end_if %> <% end_if %>
<% if Can(edit) %> <% if Can(edit) %>
<td width="18"><a class="popuplink editlink" href="$EditLink" target="_blank"><img src="cms/images/edit.gif" alt="edit" /></a></td> <td width="18"><a class="popuplink editlink" href="$EditLink" target="_blank"><img src="cms/images/edit.gif" alt="<% _t('EDIT', 'edit') %>" /></a></td>
<% end_if %> <% end_if %>
<% if Can(delete) %> <% if Can(delete) %>
<td width="18"><a class="deletelink" href="$DeleteLink" title="Delete this row"><img src="cms/images/delete.gif" alt="delete" /></a></td> <td width="18"><a class="deletelink" href="$DeleteLink" title="<% _t('DELETEROW', 'Delete this row') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'delete') %>" /></a></td>
<% end_if %> <% end_if %>
</tr> </tr>
<% end_control %> <% end_control %>
<% else %> <% else %>
<tr class="notfound"> <tr class="notfound">
<% if Markable %><th width="18">&nbsp;</th><% end_if %> <% if Markable %><th width="18">&nbsp;</th><% end_if %>
<td colspan="$Headings.Count"><i>No items found</i></td> <td colspan="$Headings.Count"><i><% _t('NOITEMSFOUND', 'No items found') %></i></td>
<% if Can(show) %><td width="18">&nbsp;</td><% end_if %> <% if Can(show) %><td width="18">&nbsp;</td><% end_if %>
<% if Can(edit) %><td width="18">&nbsp;</td><% end_if %> <% if Can(edit) %><td width="18">&nbsp;</td><% end_if %>
<% if Can(delete) %><td width="18">&nbsp;</td><% end_if %> <% if Can(delete) %><td width="18">&nbsp;</td><% end_if %>

View File

@ -15,7 +15,7 @@
<% if PopupPrevLink %> <% if PopupPrevLink %>
<td id="ComplexTableField_Pagination_Previous"> <td id="ComplexTableField_Pagination_Previous">
<a href="$PopupPrevLink"><img src="cms/images/pagination/record-prev.png" /></a> <a href="$PopupPrevLink"><img src="cms/images/pagination/record-prev.png" /></a>
<a href="$PopupPrevLink"><div>Previous</div></a> <a href="$PopupPrevLink"><div><% _t('PREVIOUS', 'Previous') %></div></a>
</td> </td>
<% end_if %> <% end_if %>
<% if TotalCount == 1 %> <% if TotalCount == 1 %>
@ -33,7 +33,7 @@
<% if PopupNextLink %> <% if PopupNextLink %>
<td id="ComplexTableField_Pagination_Next"> <td id="ComplexTableField_Pagination_Next">
<a href="$PopupNextLink"><img src="cms/images/pagination/record-next.png" /></a> <a href="$PopupNextLink"><img src="cms/images/pagination/record-next.png" /></a>
<a href="$PopupNextLink"><div>Next</div></a> <a href="$PopupNextLink"><div><% _t('NEXT', 'Next') %></div></a>
</td> </td>
<% end_if %> <% end_if %>
</td> </td>

View File

@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head>
<% base_tag %> <% base_tag %>
<title>Image Uploading Iframe</title> <title><% _t('TITLE', 'Image Uploading Iframe') %></title>
</head> </head>
<body> <body>

View File

@ -4,6 +4,6 @@
<td class="field-$Title.HTMLATT">$Value</td> <td class="field-$Title.HTMLATT">$Value</td>
<% end_control %> <% end_control %>
<% if Can(delete) %> <% if Can(delete) %>
<td width="16"><a class="deletelink" href="$DeleteLink"><img src="cms/images/delete.gif" alt="delete" /></a></td> <td width="16"><a class="deletelink" href="$DeleteLink"><img src="cms/images/delete.gif" alt="<% _t('Form.DELETE') %>" /></a></td>
<% end_if %> <% end_if %>
</tr> </tr>

View File

@ -1,15 +1,15 @@
<% if ShowPagination %> <% if ShowPagination %>
<div class="PageControls"> <div class="PageControls">
<% if LastLink %><a class="Last" href="$LastLink" title="View last $PageSize members"><img src="cms/images/pagination/record-last.png" alt="View last $PageSize members" /></a> <% if LastLink %><a class="Last" href="$LastLink" title="View last $PageSize members"><img src="cms/images/pagination/record-last.png" alt="View last $PageSize" /></a>
<% else %><span class="Last"><img src="cms/images/pagination/record-last-g.png" alt="View last $PageSize members" /></span><% end_if %> <% else %><span class="Last"><img src="cms/images/pagination/record-last-g.png" alt="View last $PageSize members" /></span><% end_if %>
<% if FirstLink %><a class="First" href="$FirstLink" title="View first $PageSize members"><img src="cms/images/pagination/record-first.png" alt="View first $PageSize members" /></a> <% if FirstLink %><a class="First" href="$FirstLink" title="View first $PageSize members"><img src="cms/images/pagination/record-first.png" alt="View first $PageSize" /></a>
<% else %><span class="First"><img src="cms/images/pagination/record-first-g.png" alt="View first $PageSize members" /></span><% end_if %> <% else %><span class="First"><img src="cms/images/pagination/record-first-g.png" alt="View first $PageSize members" /></span><% end_if %>
<% if PrevLink %><a class="Prev" href="$PrevLink" title="View previous $PageSize members"><img src="cms/images/pagination/record-prev.png" alt="View previous $PageSize members" /></a> <% if PrevLink %><a class="Prev" href="$PrevLink" title="View previous $PageSize members"><img src="cms/images/pagination/record-prev.png" alt="View previous $PageSize" /></a>
<% else %><img class="Prev" src="cms/images/pagination/record-prev-g.png" alt="View previous $PageSize members" /><% end_if %> <% else %><img class="Prev" src="cms/images/pagination/record-prev-g.png" alt="View previous $PageSize members" /><% end_if %>
<span class="Count"> <span class="Count">
Displaying $FirstItem to $LastItem of $TotalCount Displaying $FirstItem to $LastItem of $TotalCount
</span> </span>
<% if NextLink %><a class="Next" href="$NextLink" title="View next $PageSize members"><img src="cms/images/pagination/record-next.png" alt="View next $PageSize members" /></a> <% if NextLink %><a class="Next" href="$NextLink" title="View next $PageSize members"><img src="cms/images/pagination/record-next.png" alt="View next $PageSize" /></a>
<% else %><img class="Next" src="cms/images/pagination/record-next-g.png" alt="View next $PageSize members" /><% end_if %> <% else %><img class="Next" src="cms/images/pagination/record-next-g.png" alt="View next $PageSize" /><% end_if %>
</div> </div>
<% end_if %> <% end_if %>

View File

@ -29,7 +29,7 @@
<% if Can(add) %> <% if Can(add) %>
<tr> <tr>
<td colspan="$ItemCount"> <td colspan="$ItemCount">
<a href="#" class="addrow" title="Add a new row"><img src="cms/images/add.gif" alt="add" /> Add $Title</a> <a href="#" class="addrow" title="Add a new row"><img src="cms/images/add.gif" alt="<% _t('ADD') %>" /> <% _t('ADDITEM') %> $Title</a>
</td> </td>
<td style="display: none"></td> <td style="display: none"></td>
<% if Can(delete) %><td width="18">&nbsp;</td><% end_if %> <% if Can(delete) %><td width="18">&nbsp;</td><% end_if %>
@ -44,13 +44,13 @@
<td class="$FieldClass $ExtraClass $ClassName $Title tablecolumn">$Field</td> <td class="$FieldClass $ExtraClass $ClassName $Title tablecolumn">$Field</td>
<% end_control %> <% end_control %>
<td style="display: none">$ExtraData</td> <td style="display: none">$ExtraData</td>
<% if Can(delete) %><td width="18"><a class="deletelink" href="$DeleteLink" title="Delete this row"><img src="cms/images/delete.gif" alt="delete" /></a></td><% end_if %> <% if Can(delete) %><td width="18"><a class="deletelink" href="$DeleteLink" title="<% _t('DELETEROW') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE') %>" /></a></td><% end_if %>
</tr> </tr>
<% end_control %> <% end_control %>
<% else %> <% else %>
<tr class="notfound"> <tr class="notfound">
<% if Markable %><th width="18">&nbsp;</th><% end_if %> <% if Markable %><th width="18">&nbsp;</th><% end_if %>
<td colspan="$Headings.Count"><i>No $NamePlural found</i></td> <td colspan="$Headings.Count"><i><% _t('NOITEMSFOUND') %></i></td>
<% if Can(delete) %><td width="18">&nbsp;</td><% end_if %> <% if Can(delete) %><td width="18">&nbsp;</td><% end_if %>
</tr> </tr>
<% end_if %> <% end_if %>
@ -58,7 +58,7 @@
</table> </table>
<div class="utility"> <div class="utility">
<% if Can(export) %> <% if Can(export) %>
<a href="$ExportLink" target="_blank">Export to CSV</a> <a href="$ExportLink" target="_blank"><% _t('CSVEXPORT', 'Export to CSV' ) %></a>
<% end_if %> <% end_if %>
</div> </div>
</div> </div>

View File

@ -20,9 +20,9 @@
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>"> <span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
<a href="$SortLink""> <a href="$SortLink"">
<% if SortDirection = desc %> <% if SortDirection = desc %>
<img src="cms/images/bullet_arrow_up.png" alt="Sort ascending" /> <img src="cms/images/bullet_arrow_up.png" alt="<% _t('SORTASC') %>" />
<% else %> <% else %>
<img src="cms/images/bullet_arrow_down.png" alt="Sort descending" /> <img src="cms/images/bullet_arrow_down.png" alt="<% _t('SORTDESC') %>" />
<% end_if %> <% end_if %>
</a> </a>
&nbsp; &nbsp;
@ -63,12 +63,12 @@
<% else %> <% else %>
<tr class="notfound"> <tr class="notfound">
<% if Markable %><th width="18">&nbsp;</th><% end_if %> <% if Markable %><th width="18">&nbsp;</th><% end_if %>
<td colspan="$Headings.Count"><i>No items found</i></td> <td colspan="$Headings.Count"><i><% _t('NOITEMSFOUND') %></i></td>
<% if Can(delete) %><td width="18">&nbsp;</td><% end_if %> <% if Can(delete) %><td width="18">&nbsp;</td><% end_if %>
</tr> </tr>
<% end_if %> <% end_if %>
<% if Can(add) %> <% if Can(add) %>
$AddRecordForm.AsTableRow $AddRecordAsTableRow
<% end_if %> <% end_if %>
<% end_if %> <% end_if %>
</tbody> </tbody>

View File

@ -1,7 +1,7 @@
<div id="$Name" class="$Type $extraClass"> <div id="$Name" class="$Type $extraClass">
<h$HeadingLevel style="cursor: pointer;" class="trigger$ClosedClass"> <h$HeadingLevel style="cursor: pointer;" class="trigger$ClosedClass">
<img class="triggerClosed" src="sapphire/images/toggle-closed.gif" alt="+" style="display:none;" title="Show" /> <img class="triggerClosed" src="sapphire/images/toggle-closed.gif" alt="+" style="display:none;" title="<% _t('SHOW', 'Show') %>" />
<img class="triggerOpened" src="sapphire/images/toggle-open.gif" alt="-" style="display:none;" title="Hide" /> <img class="triggerOpened" src="sapphire/images/toggle-open.gif" alt="-" style="display:none;" title="<% _t('HIDE', 'Hide') %>" />
$Title $Title
</h$HeadingLevel> </h$HeadingLevel>
<div class="contentMore"> <div class="contentMore">

View File

@ -1,6 +1,11 @@
<p>Hi $FirstName,</p> <p><% _t('HELLO', 'Hi')) %> $FirstName,</p>
<p>You changed your password for $BaseHref.<br /> <p>
You can now use the following credentials to log in:</p> <% _t('CHANGEPASSWORDTEXT1', 'You changed your password for', PR_MEDIUM, 'for a url') %>$BaseHref.<br />
<p>E-mail: $Email<br /> <% _t('CHANGEPASSWORDTEXT2', 'You can now use the following credentials to log in:')
Password: $CleartextPassword</p> </p>
<p>
<% _t('EMAIL') %>: $Email<br />
<% _t('PASSWORD') %>: $CleartextPassword
</p>

View File

@ -1,4 +1,4 @@
<p>Hi $FirstName,</p> <p><% _t('HELLO', 'Hi')) %> $FirstName,</p>
<p>Here's is your <a href="$PasswordResetLink">password reset link</a> for $BaseHref</p> <p>Here's is your <a href="$PasswordResetLink">password reset link</a> for $BaseHref</p>