Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load($section, $isdatahandler=false, $supress_error=false)
- {
- // Assign language variables.
- // Datahandlers are never in admin lang directory.
- if($isdatahandler === true)
- {
- $this->language = str_replace('/admin', '', $this->language);
- }
- $lfile = $this->path."/".$this->language."/".$section.".lang.php";
- if(file_exists($lfile))
- {
- require_once $lfile;
- }
- elseif(file_exists($this->path."/english/".$section.".lang.php"))
- {
- require_once $this->path."/english/".$section.".lang.php";
- }
- else
- {
- if($supress_error != true)
- {
- die("$lfile does not exist");
- }
- }
- // We must unite and protect our language variables!
- $lang_keys_ignore = array('language', 'path', 'settings');
- if(is_array($l))
- {
- foreach($l as $key => $val)
- {
- if((empty($this->$key) || $this->$key != $val) && !in_array($key, $lang_keys_ignore))
- {
- $this->$key = $val;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement