Exemplo n.º 1
0
 public function handleSave(array $params, rex_sql $sqlFields)
 {
     if (rex_request_method() != 'post' || !isset($params['id'])) {
         return $params;
     }
     $sql = rex_sql::factory();
     // $sql->setDebug();
     $sql->setTable(rex::getTablePrefix() . 'clang');
     $sql->setWhere('id=:id', ['id' => $params['id']]);
     parent::fetchRequestValues($params, $sql, $sqlFields);
     // do the save only when metafields are defined
     if ($sql->hasValues()) {
         $sql->update();
     }
     rex_clang_service::generateCache();
     return $params;
 }
Exemplo n.º 2
0
    } elseif ($createdb == 0) {
        $error = rex_setup_importer::prepareEmptyDb();
        if ($error != '') {
            $errors[] = rex_view::error($error);
        }
    } else {
        $errors[] = rex_view::error(rex_i18n::msg('error_undefined'));
    }
    if (count($errors) == 0 && $createdb !== '') {
        $error = rex_setup_importer::verifyDbSchema();
        if ($error != '') {
            $errors[] = $error;
        }
    }
    if (count($errors) == 0) {
        rex_clang_service::generateCache();
    } else {
        $step = 5;
    }
}
if ($step > 5) {
    if (!rex_setup_importer::verifyDbSchema() == '') {
        $step = 5;
    }
}
if ($step == 5) {
    $tables_complete = rex_setup_importer::verifyDbSchema() == '' ? true : false;
    $createdb = rex_post('createdb', 'int', '');
    $headline = rex_view::title(rex_i18n::msg('setup_500'));
    $content = '
            <fieldset>
Exemplo n.º 3
0
 /**
  * Loads the cache if not already loaded.
  */
 private static function checkCache()
 {
     if (self::$cacheLoaded) {
         return;
     }
     $file = rex_path::cache('clang.cache');
     if (!file_exists($file)) {
         rex_clang_service::generateCache();
     }
     foreach (rex_file::getCache($file) as $id => $clang) {
         self::$clangs[$id] = new self($id, $clang['code'], $clang['name'], $clang['priority']);
     }
     self::$cacheLoaded = true;
 }
Exemplo n.º 4
0
 /**
  * Loads the cache if not already loaded.
  */
 private static function checkCache()
 {
     if (self::$cacheLoaded) {
         return;
     }
     $file = rex_path::coreCache('clang.cache');
     if (!file_exists($file)) {
         rex_clang_service::generateCache();
     }
     foreach (rex_file::getCache($file) as $id => $data) {
         $clang = new self();
         foreach ($data as $key => $value) {
             $clang->{$key} = $value;
         }
         self::$clangs[$id] = $clang;
     }
     self::$cacheLoaded = true;
 }