Exemplo n.º 1
0
 public static function getTableEdit()
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $Language = \CmsDev\Language\CheckLanguage::get();
     $query = $SKTDB->get_row("SELECT AdminParams FROM language WHERE Prefix = '" . $Language . "'");
     if ($query->AdminParams != '') {
         $params = json_decode($query->AdminParams, true);
         if (is_array($params)) {
             $HTML = '<table><tr><td>Parametro</td><td>Valor</td></tr>';
             foreach ($params as $variable => $value) {
                 if (!is_array($value)) {
                     $HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $value . '</td></tr>';
                 } else {
                     $NewvalueToArray = \json_encode($value);
                     $HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $NewvalueToArray . '</td></tr>';
                 }
             }
             $HTML .= '</table>';
             return $HTML;
         } else {
             $ErrorMessageBox = "Error al cargar las variables de sistema en CmsDev\\Language\\getParams(). Puede existir un json mal formado. Verifique la tabla de lenguaje o consulte al Administrador.";
             $MessageBox = SKT_INFO\Asistance::get();
             $MessageBox->TipError($ErrorMessageBox, true);
             //
             //$AdminParams=substr($query->AdminParams,strrpos($query->AdminParams,"\"")-200,200);
             //echo "<pre>".$AdminParams."</pre>";
         }
     } else {
         self::setParamsFromFile();
     }
 }
Exemplo n.º 2
0
 private static function getParams()
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $Language = \CmsDev\Language\CheckLanguage::get();
     $query = $SKTDB->get_row("SELECT SiteParams FROM language WHERE Prefix = '" . $Language . "'");
     if ($query->SiteParams != '') {
         $params = json_decode($query->SiteParams, true);
         foreach ($params as $variable => $value) {
             if (!\defined('SKT' . $variable)) {
                 if (!\is_array($value)) {
                     \define('SKT' . $variable, $value);
                 } else {
                     $NewvalueToArray = \json_encode($value);
                     \define('SKT' . $variable, $NewvalueToArray);
                 }
             } else {
                 break;
             }
         }
     } else {
         self::setParamsFromFile();
     }
 }