summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/controls/Layout.php
diff options
context:
space:
mode:
authorwei <>2007-01-11 05:06:31 +0000
committerwei <>2007-01-11 05:06:31 +0000
commit65731b050199ab7ecdd4027fa2d65f2175fe561e (patch)
tree45998ad5dec4d3caec932d663acc9fed9522f09f /demos/quickstart/protected/controls/Layout.php
parent03f362a40a8dd39f8c8b4bf816334922b7b264e4 (diff)
Add structure for localized quickstart.
Diffstat (limited to 'demos/quickstart/protected/controls/Layout.php')
-rw-r--r--demos/quickstart/protected/controls/Layout.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/demos/quickstart/protected/controls/Layout.php b/demos/quickstart/protected/controls/Layout.php
index 7c2cbd85..e4f2fc1a 100644
--- a/demos/quickstart/protected/controls/Layout.php
+++ b/demos/quickstart/protected/controls/Layout.php
@@ -24,6 +24,24 @@ class Layout extends TTemplateControl
$this->MainMenu->Visible=false;
$this->TopicPanel->Visible=false;
}
+
+ $this->languages->DataSource = TPropertyValue::ensureArray($this->Application->Parameters['languages']);
+ $this->languages->dataBind();
+ }
+
+ public function language_links($sender, $param)
+ {
+ $item = $param->Item;
+ if($item->ItemType == TListItemType::Item || $item->ItemType == TListItemType::AlternatingItem)
+ {
+ $params = $this->Request->toArray();
+ $params['lang'] = $sender->DataKeys[$item->ItemIndex];
+ unset($params[$this->Request->ServiceID]);
+ $url = $this->Service->ConstructUrl($this->Service->RequestedPagePath, $params);
+ $item->link->NavigateUrl = $url;
+ if($this->Application->Globalization->Culture == $params['lang'])
+ $item->link->CssClass="active";
+ }
}
}