Skip to content

Commit

Permalink
Added locale css demonstration per pi-engine#1195
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwen committed Aug 29, 2014
1 parent 439d16c commit 7e417b8
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/Pi/View/Helper/Css.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* // Load specific file with attributes
* $this->css('some.css',
* array('conditional' => '...', 'postion' => 'prepend'));
* array('conditional' => '...', 'position' => 'prepend'));
*
* // Load a list of files
* $this->css(array(
Expand Down
2 changes: 1 addition & 1 deletion lib/Pi/View/Helper/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Usage inside a phtml template
*
* ```
* $this->i18n('theme/default', 'main');
* $this->i18n('theme/default', 'default');
* $this->i18n('module/demo', 'block');
* ```
*
Expand Down
12 changes: 12 additions & 0 deletions usr/theme/default/asset/locale/en/locale.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Locale css file
*
* Load in a theme template
* ```
* $this->css($this->assetLocale('locale.css'));
* ```
*/
.rtl {
direction: RTL;
unicode-bidi: embed;
}
8 changes: 8 additions & 0 deletions usr/theme/default/asset/locale/en/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Locale js file
*
* Load in a theme template
* ```
* $this->js($this->assetLocale('locale.js'));
* ```
*/
4 changes: 0 additions & 4 deletions usr/theme/default/asset/locale/en/rtl.css

This file was deleted.

1 change: 0 additions & 1 deletion usr/theme/default/asset/locale/en/rtl.js

This file was deleted.

12 changes: 12 additions & 0 deletions usr/theme/default/asset/locale/fa/locale.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Locale css file
*
* Load in a theme template
* ```
* $this->css($this->assetLocale('locale.css'));
* ```
*/
.rtl {
direction: RTL;
unicode-bidi: embed;
}
8 changes: 8 additions & 0 deletions usr/theme/default/asset/locale/fa/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Locale js file
*
* Load in a theme template
* ```
* $this->js($this->assetLocale('locale.js'));
* ```
*/
12 changes: 12 additions & 0 deletions usr/theme/default/asset/locale/zh-cn/locale.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Locale css file
*
* Load in a theme template
* ```
* $this->css($this->assetLocale('locale.css'));
* ```
*/
.rtl {
direction: RTL;
unicode-bidi: embed;
}
8 changes: 8 additions & 0 deletions usr/theme/default/asset/locale/zh-cn/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Locale js file
*
* Load in a theme template
* ```
* $this->js($this->assetLocale('locale.js'));
* ```
*/
3 changes: 3 additions & 0 deletions usr/theme/default/template/layout-admin.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ $this->bootstrap(array(
// Load admin.css
$this->css($this->assetTheme('css/admin.css'));

// Load localization css
$this->css($this->assetLocale('locale.css'));

// Explicitly load favicon
// @see http://en.wikipedia.org/wiki/Favicon
$this->headLink(array(
Expand Down
3 changes: 3 additions & 0 deletions usr/theme/default/template/layout-front.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ $this->bootstrap(array(
// Load front.css
$this->css($this->assetTheme('css/front.css'));

// Load localization css
$this->css($this->assetLocale('locale.css'));

// Apple icons
// Apple icon for iphone
$this->headLink(array(
Expand Down
5 changes: 4 additions & 1 deletion usr/theme/default/template/layout-simple.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ $this->bootstrap(array(
// Load front.css
$this->css($this->assetTheme('css/front.css'));

// Load localization css
$this->css($this->assetLocale('locale.css'));

// Apple icons
// Apple icon for iphone
$this->headLink(array(
Expand Down Expand Up @@ -96,7 +99,7 @@ $module = Pi::service('module')->current();
<div class="pi-module-content" ng-app="<?php echo $module; ?>">
<?php echo $content; ?>
</div>
</div>
</div>>
<?php } ?>
<!-- Module content ends -->

Expand Down
2 changes: 1 addition & 1 deletion usr/theme/default/template/layout-style.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $module = Pi::service('module')->current();
<div class="pi-module-content" ng-app="<?php echo $module; ?>">
<?php echo $content; ?>
</div>
</div>
</div>>
<?php } ?>
</div>

Expand Down
2 changes: 2 additions & 0 deletions usr/theme/pi/template/layout-front.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ $this->bootstrap(array(
'font-awesome/css/font-awesome.min.css'
));
$this->css($this->assetTheme('css/front.css'));
$this->css($this->assetLocale('locale.css'));

$this->headLink(array(
'rel' => 'apple-touch-icon',
'href' => $this->assetTheme('image/touch-icon-iphone.png')
Expand Down

0 comments on commit 7e417b8

Please sign in to comment.