Example #1
0
 public function load($filename, $directory, $default)
 {
     $data = [];
     $_ = [];
     //load extension language default
     $file = Extension::dirExtension() . '*/*/' . Util::getConfig('environment') . '/language/' . $default . '/' . $filename . '.php';
     $file_extensions = glob($file);
     foreach ($file_extensions as $file_extension) {
         if (file_exists($file_extension)) {
             require \Vqmod::modCheck($file_extension);
         }
     }
     $data = array_merge($data, $_);
     //load extension language
     $file = Extension::dirExtension() . '*/*/' . Util::getConfig('environment') . '/language/' . $directory . '/' . $filename . '.php';
     $file_extensions = glob($file);
     foreach ($file_extensions as $file_extension) {
         if (file_exists($file_extension)) {
             require $file_extension;
         }
     }
     $data = array_merge($data, $_);
     //load theme language
     $file_theme = Theme::dirCurrentTheme() . '/language/' . $default . '/' . $filename . '.php';
     if (file_exists($file_theme)) {
         require $file_theme;
     }
     $data = array_merge($data, $_);
     $file_theme = Theme::dirCurrentTheme() . '/language/' . $directory . '/' . $filename . '.php';
     if (file_exists($file_theme)) {
         require $file_theme;
     }
     $data = array_merge($data, $_);
     return $data;
 }
Example #2
0
 public static function dirCurrentTheme()
 {
     return DIR_TEMPLATE . Util::getConfig('config_template');
 }
Example #3
0
 /**
  * Get view raw php tpl
  * @param       $template
  * @param array $data
  * @return string
  */
 private function viewRaw($template, $data = array())
 {
     //load extension view raw
     $extensions_file = glob(DIR_ROOT . '/' . Util::getConfig('theme_path') . '/' . Util::getConfig('config_template') . '/template/' . $template);
     if ($extensions_file && is_array($extensions_file) && count($extensions_file)) {
         $file = $extensions_file[0];
     } else {
         $file = DIR_TEMPLATE . $template;
     }
     if (file_exists($file)) {
         extract($data);
         ob_start();
         require $file;
         $output = ob_get_contents();
         ob_end_clean();
     } else {
         trigger_error('Error: Could not load template ' . $file . '!');
         exit;
     }
     return $output;
 }
Example #4
0
 /**
  * Diretorio onde a extensoes vao ficar
  * @return string
  */
 public static function dirExtension()
 {
     return DIR_ROOT . '/' . Util::getConfig('extension_path') . '/';
 }