Example #1
0
 public function __routeBundle($path)
 {
     /**
      * Security access for development
      */
     e::$security->developerAccess("EvolutionSDK Management Center");
     // Get name
     $name = array_shift($path);
     // Site sandbox TODO MOVE THIS SOMEWHERE ELSE?
     if ($name == 'sandbox') {
         $path = implode('/', $path);
         if ($path === '') {
             $path = 'index';
         }
         $file = e\site . '/sandbox/' . $path . '.php';
         $dir = dirname($file);
         if (!is_dir($dir)) {
             throw new Exception("Sandbox directory `{$dir}` does not exist");
         }
         chdir($dir);
         echo '<style>body {margin: 0; padding: 0; font-family: Tahoma, Lucida Grande, Sans, sans-serif;}</style>';
         echo '<div style="padding: 1em; background: black; box-shadow: 0 0 4px #000; color: #fff;"><b>Sandbox File </b>';
         echo '<pre style="display: inline">' . $file . '</pre></div>';
         require_once $file;
         e\complete();
     }
     if ($name === 'manage') {
         e\redirect('/@manage');
     }
     if ($name === '' || is_null($name)) {
         $name = 'manage';
     }
     $bundles = e::configure('manage')->bundle;
     $ns = array_search($name, $bundles);
     if ($ns === false) {
         throw new Exception("No manage panel for `{$name}`");
     }
     $class = $ns . '\\Manage';
     $panel = new $class();
     $title = "EvolutionSDK&trade; &rarr; " . $panel->title;
     $css = file_get_contents(__DIR__ . '/../debug/theme.css') . self::style();
     $header = '<span>EvolutionSDK</span> &rarr; <a href="/@manage">Manage System</a>' . ($name !== 'manage' ? " &rarr; <span>" . $panel->title . "</span>" : '');
     echo "<!doctype html><html><head><title>{$title}</title><style>{$css}</style></head><body class='_e_dump'><h1>{$header}</h1><div class='manage-page'>";
     echo $panel->page($path);
     echo "</div></body></html>";
     e\complete();
 }
Example #2
0
 public function update()
 {
     $return = '/';
     foreach ($_POST as $var => $value) {
         $var = base64_decode($var);
         if ($var == '_return') {
             $return = $value;
         } else {
             if (strlen($var) > 1) {
                 self::$environment[$var] = $value;
             }
         }
     }
     $this->save();
     e\redirect($return);
 }