Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. function load($section, $isdatahandler=false, $supress_error=false)
  2.     {
  3.         // Assign language variables.
  4.         // Datahandlers are never in admin lang directory.
  5.         if($isdatahandler === true)
  6.         {
  7.             $this->language = str_replace('/admin', '', $this->language);
  8.         }
  9.         $lfile = $this->path."/".$this->language."/".$section.".lang.php";
  10.        
  11.         if(file_exists($lfile))
  12.         {
  13.             require_once $lfile;
  14.         }
  15.         elseif(file_exists($this->path."/english/".$section.".lang.php"))
  16.         {
  17.             require_once $this->path."/english/".$section.".lang.php";
  18.         }
  19.         else
  20.         {
  21.             if($supress_error != true)
  22.             {
  23.                 die("$lfile does not exist");
  24.             }
  25.         }
  26.        
  27.         // We must unite and protect our language variables!
  28.         $lang_keys_ignore = array('language', 'path', 'settings');
  29.        
  30.         if(is_array($l))
  31.         {
  32.             foreach($l as $key => $val)
  33.             {
  34.                 if((empty($this->$key) || $this->$key != $val) && !in_array($key, $lang_keys_ignore))
  35.                 {
  36.                     $this->$key = $val;
  37.                 }
  38.             }
  39.         }
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement