diff options
Diffstat (limited to 'demos/quickstart/protected/controls')
| -rw-r--r-- | demos/quickstart/protected/controls/Layout.php | 18 | ||||
| -rw-r--r-- | demos/quickstart/protected/controls/Layout.tpl | 12 | ||||
| -rw-r--r-- | demos/quickstart/protected/controls/fr/TopicList.tpl | 10 | 
3 files changed, 40 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";
 +		}
  	}
  }
 diff --git a/demos/quickstart/protected/controls/Layout.tpl b/demos/quickstart/protected/controls/Layout.tpl index 52ab5bc4..87013156 100644 --- a/demos/quickstart/protected/controls/Layout.tpl +++ b/demos/quickstart/protected/controls/Layout.tpl @@ -29,6 +29,18 @@  <com:TopicList ID="TopicPanel" />
  </td>
  <td valign="top">
 +
 +<com:TRepeater ID="languages" OnItemCreated="language_links">
 +	<prop:HeaderTemplate>
 +		<div class="languages">Available Languages: <ul>
 +	</prop:HeaderTemplate>
 +	<prop:ItemTemplate>
 +		<li><com:THyperLink ID="link" Text=<%# $this->DataItem %> /></li>
 +	</prop:ItemTemplate>
 +	<prop:FooterTemplate>
 +		</ul></div>
 +	</prop:FooterTemplate>
 +</com:TRepeater>
  <div id="content">
  <com:TContentPlaceHolder ID="body" />
  </div>
 diff --git a/demos/quickstart/protected/controls/fr/TopicList.tpl b/demos/quickstart/protected/controls/fr/TopicList.tpl new file mode 100644 index 00000000..048f00fd --- /dev/null +++ b/demos/quickstart/protected/controls/fr/TopicList.tpl @@ -0,0 +1,10 @@ +<div id="toc">
 +
 +<div class="topic">
 +<div>Getting Started</div>
 +<ul>
 +    <li><a href="?page=GettingStarted.Introduction">Introduction</a></li>
 +</ul>
 +</div>
 +
 +</div>
\ No newline at end of file | 
