Skip to content

Commit

Permalink
Release 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed May 15, 2012
1 parent 11eca85 commit bd9405d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
10 changes: 1 addition & 9 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
Page LHandles
==============

Offers multilingual support for localised page handles in browser URL.

* Version: 2.5
* Build Date: 2012-05-11
* Authors:
- [Vlad Ghita](http://www.xanderadvertising.com)
* Requirements:
- Symphony 2.3
- [Frontend localisation 1.4](https://github.com/vlad-ghita/frontend_localisation)
Offers support to localise Page titles and Handles.



Expand Down
42 changes: 15 additions & 27 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_once('lib/class.datasource.MultilingualNavigation.php');
require_once('lib/class.PLHDatasourceManager.php');
require_once('lib/class.PLHManagerURL.php');
require_once(EXTENSIONS.'/frontend_localisation/extension.driver.php');
require_once(EXTENSIONS.'/frontend_localisation/lib/class.FLang.php');


Expand Down Expand Up @@ -242,7 +243,7 @@ public function dFrontendPrePageResolve($context){
* @param array $context - see delegate description
*/
public function dAppendPageContent($context){
$this->_appendAssets();
Extension_Frontend_Localisation::appendAssets();

$main_lang = FLang::getMainLang();
$all_langs = FLang::getAllLangs();
Expand All @@ -251,32 +252,30 @@ public function dAppendPageContent($context){
$fieldset = new XMLElement('fieldset', null, array('class' => 'settings'));
$fieldset->appendChild(new XMLElement('legend', __('Page LHandles')));

$group = new XMLElement('div', null, array('class' => 'field-multilingual'));
$container = new XMLElement('div', null, array('class' => 'field-multilingual'));


/* Tabs */

$ul = new XMLElement('ul', '', array('class' => 'tabs'));
/*------------------------------------------------------------------------------------------------*/
/* Tabs */
/*------------------------------------------------------------------------------------------------*/

$ul = new XMLElement('ul', null, array('class' => 'tabs'));
foreach( $langs as $lc ){
$li = new XMLElement(
'li',
$all_langs[$lc] ? $all_langs[$lc] : __('Unknown Lang : %s', array($lc)),
array('class' => $lc.($lc === $main_lang ? ' active' : ''))
);

$li = new XMLElement('li', $all_langs[$lc], array('class' => $lc));
$lc === $main_lang ? $ul->prependChild($li) : $ul->appendChild($li);
}

$group->appendChild($ul);
$container->appendChild($ul);


/* Content */
/*------------------------------------------------------------------------------------------------*/
/* Panels */
/*------------------------------------------------------------------------------------------------*/

foreach( $langs as $lc ){

// title
$group->appendChild(
$container->appendChild(
Widget::Label(
__('Localised Title'),
Widget::Input(
Expand All @@ -290,7 +289,7 @@ public function dAppendPageContent($context){
);

// handle
$group->appendChild(
$container->appendChild(
Widget::Label(
__('Localised URL Handle'),
Widget::Input(
Expand All @@ -305,7 +304,7 @@ public function dAppendPageContent($context){
}


$fieldset->appendChild($group);
$fieldset->appendChild($container);
$context['form']->prependChild($fieldset);
}

Expand Down Expand Up @@ -558,15 +557,4 @@ private function _validateDependencies(){
return (boolean) ($fl_status[0] === EXTENSION_ENABLED);
}

private function _appendAssets(){
$this->assets_loaded = true;

$page = Administration::instance()->Page;

// multilingual stuff
$fl_assets = URL.'/extensions/frontend_localisation/assets/frontend_localisation.multilingual_tabs';
$page->addStylesheetToHead($fl_assets.'.css', 'screen', null, false);
$page->addScriptToHead($fl_assets.'_init.js', null, false);
}

}
6 changes: 5 additions & 1 deletion extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
</authors>

<dependencies>
<dependency version="1.5">https://github.com/vlad-ghita/frontend_localisation</dependency>
<dependency version="1.6">https://github.com/vlad-ghita/frontend_localisation</dependency>
</dependencies>

<releases>
<release version="2.6" date="2012-04-14"><![CDATA[
* Frontend Localisation 1.6 compatibility
]]></release>

<release version="2.5" date="2012-04-14"><![CDATA[
* Symphony 2.3 compatibility.
]]></release>
Expand Down

0 comments on commit bd9405d

Please sign in to comment.