Example #1
0
 /**
  * Genera los strings de traduccion segun el idioma configurado
  *
  * @param string $website Nombre de archivo .yml
  * @param string $weblang Ruta de archivo .yml
  *
  * @return true
  * ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
  * @author Luis Gdonis <*****@*****.**>
  * @since  2.0.0.0-alpha
  */
 public static function genLocale($website, $weblang)
 {
     /*
      * Genera etiquetas si hay multiidioma configurado
      */
     if (Configure::read('lang')) {
         self::$_localestrings = self::_locale($website, $weblang);
     }
 }
Example #2
0
 /**
  * Webpage
  * Renderiza pagina web
  *
  * @param array $LesliController Informacion de controlador
  *
  * @return true
  * ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
  * @author Luis Gdonis <*****@*****.**>
  * @since  2.0.0.0-alpha
  */
 private function _webpage($LesliController)
 {
     /*
      *  Variables propias del sitio
      */
     $website = $LesliController['WEBSITE_site'];
     //Sitio solicitado por url
     $weblang = $LesliController['WEBSITE_lang'];
     //Idioma solicitado
     $webparams = $LesliController['DATA_params'];
     //Parametros GET
     /*
      *  Obtiene configuracion de plantillas
      */
     $Leslitemplate = Configure::read('template');
     $Leslitemplate = isset($Leslitemplate[$website]) ? $Leslitemplate[$website] : $Leslitemplate['default'];
     /*
      *  Obtiene ruta de plantilla principal
      */
     $Leslitemplate = Template::getTemplate($Leslitemplate);
     /*
      *  Contenido dinamico
      */
     $content = Template::getTemplate($website, $website);
     /*
      * Genera etiquetas multi idioma
      */
     LesliLocale::genLocale($website, $weblang);
     /*
      * Obtiene la funcion que retorna cadenas traducidas
      */
     $_ = function ($texto, $grupo = null) {
         return LesliLocale::getString($texto, $grupo);
     };
     /*
      * Obtiene la funcion que imprime cadenas traducidas
      */
     $e = function ($texto, $grupo = null) use($_) {
         echo $_($texto, $grupo);
     };
     /*
      *  Crea variables
      *  configuradas en config.php
      */
     extract(Configure::read('vars'));
     /*
      *  Obtiene plantilla
      */
     include $Leslitemplate;
 }