Example #1
0
 public static function get_folder_path($id)
 {
     if (!$id) {
         return '';
     }
     static $folders = null;
     if (!config::config_exists()) {
         return false;
     }
     if ($folders === null) {
         config::load_config();
         $folders = config::search('/^folder_/');
     }
     return isset($folders['folder_' . $id]) ? $folders['folder_' . $id] : false;
 }
Example #2
0
 static function is_complete()
 {
     config::load_confdata();
     $current_config = config::load_config();
     $default_config = array();
     foreach (config::$sections as $id_sec => $sec) {
         foreach (config::$subsections[$id_sec] as $id_sub => $sub) {
             foreach (config::$fields[$id_sec][$id_sub] as $id => $field) {
                 if ($field["onsave"]) {
                     $field["onsave"]($id, $field["default"], $default_config);
                 } else {
                     $default_config[$id] = $field["default"];
                 }
             }
         }
     }
     foreach ($default_config as $id => $value) {
         if (!isset($current_config[$id])) {
             return false;
         }
     }
     return true;
 }
/**
 * -----------------------------------------------------------------------------
 * @package     smartVISU
 * @author      Joerg Herrmann
 * @copyright   2014
 * @license     GPL [http://www.gnu.de]
 * -----------------------------------------------------------------------------
 */
//error_reporting( E_ALL | E_STRICT );
error_reporting(E_ALL & ~E_NOTICE);
ini_set("display_errors", 1);
preg_match('/(.*)?\\/pages\\/.*?/', dirname(__FILE__), $system_path);
define('const_path_system', $system_path[1] . '/lib/');
define('const_path', $system_path[1] . '/');
$request = array_merge($_GET, $_POST);
//touch(const_path.'config.ini');
require_once const_path_system . 'functions_config.php';
$cfg = new config(const_path . 'config.ini');
$cfg->load_config();
$cfg->write_config($request);
// management interface,
if ($request['managed'] !== '') {
    die;
} else {
    //$cfg -> write_config($request);
    //header("HTTP/1.0 600 smartVISU Config Error");
    //$ret[] = array('title' => 'Configuration',
    //	'text' => 'Error saving configuration!<br />Please check the file permissions on "config.php" (it must be writeable)!');
    //echo json_encode($ret);
}