Example #1
0
 /**
  * @return array
  */
 protected function getDefaultVars()
 {
     $vars = array();
     $metadata = "<meta name='description' content='The study of Open Source'>\n";
     $metadata .= "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>\n";
     $vars['metadata'] = $metadata;
     if (!empty($this->title)) {
         $vars[self::TITLE] = htmlentities($this->title);
     }
     $styles = "<link rel='stylesheet' href='css/fossology.css'>\n";
     $styles .= "<link rel='stylesheet' href='css/jquery-ui.css'>\n";
     $styles .= "<link rel='stylesheet' href='css/jquery.dataTables.css'>\n";
     $styles .= "<link rel='icon' type='image/x-icon' href='favicon.ico'>\n";
     $styles .= "<link rel='shortcut icon' type='image/x-icon' href='favicon.ico'>\n";
     $styles .= $this->menu->OutputCSS();
     $vars['styles'] = $styles;
     $vars['menu'] = $this->menu->Output($this->title);
     global $SysConf;
     if (array_key_exists('BUILD', $SysConf)) {
         $vars['versionInfo'] = array('version' => $SysConf['BUILD']['VERSION'], 'buildDate' => $SysConf['BUILD']['BUILD_DATE'], 'commitHash' => $SysConf['BUILD']['COMMIT_HASH'], 'commitDate' => $SysConf['BUILD']['COMMIT_DATE']);
     }
     return $vars;
 }
Example #2
0
 /**
  * \brief This function is called when user output is
  * requested.  This function is responsible for assigning headers.
  *
  * @internal param $vars
  */
 function OutputOpen()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     $this->headers['Content-type'] = 'text/html';
     $this->headers['Pragma'] = 'no-cache';
     $this->headers['Cache-Control'] = 'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0';
     $this->headers['Expires'] = 'Expires: Thu, 19 Nov 1981 08:52:00 GMT';
     $metadata = "<meta name='description' content='The study of Open Source'>\n";
     $metadata .= "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>\n";
     $this->vars['metadata'] = $metadata;
     if (!empty($this->Title)) {
         $this->vars['title'] = htmlentities($this->Title);
     }
     $styles = "<link rel='stylesheet' href='css/fossology.css'>\n";
     $styles .= "<link rel='stylesheet' href='css/jquery-ui.css'>\n";
     $styles .= "<link rel='stylesheet' href='css/jquery.dataTables.css'>\n";
     $styles .= "<link rel='icon' type='image/x-icon' href='favicon.ico'>\n";
     $styles .= "<link rel='shortcut icon' type='image/x-icon' href='favicon.ico'>\n";
     if ($this->NoMenu == 0) {
         $styles .= $this->menu->OutputCSS();
     }
     $this->vars['styles'] = $styles;
     if ($this->NoMenu == 0) {
         $this->vars['menu'] = $this->menu->Output($this->Title);
     }
     global $SysConf;
     $this->vars['versionInfo'] = array('version' => $SysConf['BUILD']['VERSION'], 'buildDate' => $SysConf['BUILD']['BUILD_DATE'], 'commitHash' => $SysConf['BUILD']['COMMIT_HASH'], 'commitDate' => $SysConf['BUILD']['COMMIT_DATE']);
 }
 protected function setUp()
 {
     $this->session = M::mock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
     global $container;
     $container = M::mock('Container');
     $this->menu = M::mock(Menu::classname());
     $this->twigEnvironment = M::mock('\\Twig_Environment');
     $this->logger = M::mock('Monolog\\Logger');
     $container->shouldReceive('get')->with('ui.component.menu')->andReturn($this->menu);
     $container->shouldReceive('get')->with('ui.component.micromenu')->andReturn($this->microMenu);
     $container->shouldReceive('get')->with('twig.environment')->andReturn($this->twigEnvironment);
     $container->shouldReceive('get')->with('logger')->andReturn($this->logger);
     $container->shouldReceive('get')->with('session')->andReturn($this->session);
     $this->container = $container;
     $GLOBALS['container'] = $container;
     $this->plugin = new TestPlugin($this->name);
 }