use language in paginator class.
This commit is contained in:
parent
7e439ab52e
commit
c76d0fb669
|
@ -9,21 +9,21 @@ class Lang {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private static $lines = array();
|
public static $lines = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The key of the line that is being requested.
|
* The key of the line that is being requested.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $key;
|
public $key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The place-holder replacements.
|
* The place-holder replacements.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $replacements = array();
|
public $replacements = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Lang instance.
|
* Create a new Lang instance.
|
||||||
|
@ -117,7 +117,9 @@ private function parse($key)
|
||||||
*/
|
*/
|
||||||
private function load($file, $language)
|
private function load($file, $language)
|
||||||
{
|
{
|
||||||
if ( ! array_key_exists($language.$file, static::$lines) and file_exists($path = APP_PATH.'lang/'.$language.'/'.$file.EXT))
|
if (array_key_exists($language.$file, static::$lines)) return;
|
||||||
|
|
||||||
|
if (file_exists($path = APP_PATH.'lang/'.$language.'/'.$file.EXT))
|
||||||
{
|
{
|
||||||
static::$lines[$language.$file] = require $path;
|
static::$lines[$language.$file] = require $path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ private function slider($adjacent)
|
||||||
*/
|
*/
|
||||||
public function previous()
|
public function previous()
|
||||||
{
|
{
|
||||||
$text = Lang::line('pagination.previous')->get();
|
$text = Lang::line('pagination.previous')->get($this->language);
|
||||||
|
|
||||||
return ($this->page > 1) ? $this->link($this->page - 1, $text, 'prev_page').' ' : HTML::span($text, array('class' => 'disabled prev_page')).' ';
|
return ($this->page > 1) ? $this->link($this->page - 1, $text, 'prev_page').' ' : HTML::span($text, array('class' => 'disabled prev_page')).' ';
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ public function previous()
|
||||||
*/
|
*/
|
||||||
public function next()
|
public function next()
|
||||||
{
|
{
|
||||||
$text = Lang::line('pagination.next')->get();
|
$text = Lang::line('pagination.next')->get($this->language);
|
||||||
|
|
||||||
return ($this->page < $this->last_page) ? $this->link($this->page + 1, $text, 'next_page') : HTML::span($text, array('class' => 'disabled next_page'));
|
return ($this->page < $this->last_page) ? $this->link($this->page + 1, $text, 'next_page') : HTML::span($text, array('class' => 'disabled next_page'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue