Exemplo n.º 1
0
     if ($values['information']) {
         $ftp = new File_FTP($this->registry);
         foreach ($values['information'] as $key => $value) {
             $message = file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', stripslashes(str_replace('\\r\\n', '', $value)));
             $ftp->put($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', $ftp->public_html . '/' . $this->registry->get('settings.resolve') . '/file/' . $key . '.html', true);
             unlink($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html');
         }
         unset($values['information']);
         $ftp->disconnect();
     }
     foreach ($values as $section => $value) {
         foreach ($value as $key => $value) {
             $ushop_ini->set($key, $value, $section);
         }
     }
     $saved = $ushop_ini->save();
     $menuBar['back'] = '/ushop/overview';
     //check then enter the record.
     if ($saved) {
         $params['TYPE'] = 'pass';
         $params['MESSAGE'] = '<h2>Params was successfully updated.</h2>';
     } else {
         $params['TYPE'] = 'error';
         $params['MESSAGE'] = '<h2>Params could not be updated.</h2>';
     }
     // done!
 } else {
     $paramsBar = array('back' => '/ushop/overview', 'cancel' => '/ushop/overview', 'save' => '');
     $this->content .= $this->makeToolbar(array_merge($paramsBar, $menuBar), 24);
     $tab_array = array('information' => null, 'configuration' => null, 'display' => null);
     $info = array('terms' => file_exists($terms) ? file_get_contents($terms) : '', 'offline_message' => file_exists($offline_message) ? file_get_contents($offline_message) : '');
Exemplo n.º 2
0
         $template_files->set($key, $value, $section);
     }
 }
 foreach ($_POST['files'] as $file) {
     $file = split('/', $file);
     $files[$file[1]][] = $file[2];
     $template_files->set($c, '/Common/javascript/Source/' . $file[0] . '/' . $file[1] . '/' . $file[2], 'mootools_js');
     $c++;
 }
 foreach ($files as $section => $values) {
     foreach ($values as $key => $value) {
         $value = str_replace('.js', '', $value);
         $template_files->set($key, $value, $section);
     }
 }
 $template_files->save();
 $js->scripts = $template_files->get('mootools_js');
 foreach ($js->scripts as $key => $files) {
     $js->scripts[$key] = $this->registry->config->get('web_url', 'SERVER') . $files;
 }
 $js->dbug = false;
 $js->compress_file = true;
 $cache_file = $_SERVER['DOCUMENT_ROOT'] . '/Common/tmp/UthandoJsCache.js';
 $ftp = new File_FTP($this->registry);
 $script = $js->load_js();
 file_put_contents($cache_file, $script);
 if ($template_name == 'admin') {
     $dir = explode('/', $_SERVER['DOCUMENT_ROOT']);
     $ftp->put($cache_file, $ftp->public_html . '/' . end($dir) . '/templates/' . $template_name . '/js/UthandoJsCache.js', true, FTP_ASCII);
 } else {
     $ftp->put($cache_file, $ftp->public_html . '/templates/' . $template_name . '/js/UthandoJsCache.js', true, FTP_ASCII);