Esempio n. 1
0
  function testPath()
  {
    $this->assertEqual(Fs :: path(array('test')), 'test');
    $this->assertEqual(Fs :: path(array('test', 'wow')), 'test' . Fs :: separator() . 'wow');
    $this->assertEqual(Fs :: path(array('test', 'wow/')), 'test' . Fs :: separator() . 'wow');

    $this->assertEqual(Fs :: path(array('test'), true), 'test' . Fs :: separator());
    $this->assertEqual(Fs :: path(array('test', 'wow'), true), 'test' . Fs :: separator() . 'wow' . Fs :: separator());
  }
  protected function _generateDebugEditorLinkHtml($code, $file_path)
  {
    if(!defined('WS_SCRIPT_WRITTEN'))
    {

      $code->writeHtml('	<SCRIPT LANGUAGE="JScript">
                          function run_template_editor(path)
                          {
                            WS = new ActiveXObject("WScript.shell");
                            WS.exec("uedit32.exe " + path);
                          }
                          </SCRIPT>');

      define('WS_SCRIPT_WRITTEN', true);
    }

    if(Fs :: isPathRelative($file_path))
    {
      $items = Fs :: explodePath($_SERVER['PATH_TRANSLATED']);
      array_pop($items);

      $file_path = Fs :: path($items) . Fs :: separator() . $file_path;
    }

    $file_path = addslashes(Fs :: cleanPath($file_path));
    $code->writeHtml("<a href='#'><img onclick='runTemplateEditor(\"{$file_path}\");' src='/shared/images/i.gif' alt='{$file_path}' title='{$file_path}' border='0'></a>");
  }