Exemplo n.º 1
0
<?php

define('_EWA_ROOT_', dirname(__FILE__) . '/');
require_once _EWA_ROOT_ . 'classes/ewa.php';
Ewa::modprobe();
$json = 'window.ewaConfig = ' . Ewa::getConfig();
$config = Ewa::$config;
$file = isset($_GET['file']) ? new Ewa($_GET['file'], true) : false;
$editor_content = is_object($file) ? $file->content : "";
$js_rewrite_rules = Ewa::getRewriteRulesJson();
$js_modules = Ewa::getJsModulesJson();
$data = $config['dataFolder'];
include _EWA_ROOT_ . 'views/_html.php';
Exemplo n.º 2
0
Arquivo: ewa.php Projeto: auroran/EWA
 /**
  * Get config
  */
 public static function getConfig()
 {
     /*
      * Load Thirty-part library : SPYC, YAML Parser/Dumper
      */
     if (!class_exists('Spyc')) {
         require_once _EWA_ROOT_ . 'frameworks/spyc/Spyc.php';
     }
     self::$config = Spyc::YAMLLoad(_EWA_ROOT_ . 'config/editor.yml');
     self::$config['translations'] = Spyc::YAMLLoad(_EWA_ROOT_ . 'config/lang/' . self::$lang . '.yml');
     foreach (self::$configOverride as $key => $value) {
         if (is_array($value) && isset(self::$config[$key])) {
             foreach ($value as $k => $v) {
                 self::$config[$key][$k] = $value;
             }
         } else {
             self::$config[$key] = $value;
         }
     }
     return json_encode(self::$config);
 }
Exemplo n.º 3
0
        }
        if (is_file($path . $f) && !preg_match('/^(\\.|\\.\\.)/', $f) && preg_match('/\\.(png|jpg|jpeg|tiff|tif|gif)$/', $f) && $filetype == 'picture') {
            $list['Pictures'][] = $f;
        }
        if (is_file($path . $f) && !preg_match('/^(\\.|\\.\\.)/', $f) && preg_match('/\\.(avi|mov|mkv|mpg|mpeg|mp4)$/', $f) && $filetype == 'movie') {
            $list['Movies'][] = $f;
        }
    }
    include _EWA_ROOT_ . 'views/navigator.php';
}
/*
 * Resquest a folder creation
 */
if (isset($_POST['createFolder'])) {
    $path = $_POST['path'];
    if (!preg_match('/\\/$/', $path)) {
        $path .= '/';
    }
    if (!is_dir($path)) {
        exit(Ewa::json_enc(false));
    }
    if ($path == '/') {
        exit(Ewa::json_enc(false));
    }
    if (empty($_POST['createFolder'])) {
        exit(Ewa::json_enc(false));
    }
    $newFolder = Ewa::cleanFileName($_POST['createFolder']);
    $r = @mkdir($path . $newFolder);
    echo Ewa::json_enc(array('success' => $r, 'newFolder' => $newFolder, 'path' => $path));
}