summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/ResourceController.php29
-rw-r--r--library/Pbs/Notifier.php16
-rw-r--r--public/media/css/style.css4
3 files changed, 41 insertions, 8 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index e36c75a..3b4a8cb 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -8,8 +8,6 @@ class ResourceController extends Zend_Controller_Action
public function init()
{
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
$session = new Application_Model_Session();
$sm = new Application_Model_SessionMapper();
@@ -18,7 +16,7 @@ class ResourceController extends Zend_Controller_Action
//TODO Error Messages if something failed
if(!isset($bootmenuentryID)){
$alphasessionID = $this->_request->getParam('alpha');
- $result = $sm->findBy('alphasessionID',$alphasessionID);
+ $result = $sm->findBy(array('alphasessionID' => $alphasessionID),true);
# print_a($result);
$this->thisSession = $session->setOptions($result[0]);
$this->thisSession->setID($result[0]['sessionID']);
@@ -55,6 +53,9 @@ class ResourceController extends Zend_Controller_Action
public function getinitramfsAction()
{
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
$bootosID = $this->thisSession->getBootosID();
if(is_dir("../resources/bootos/$bootosID/initramfs/") && is_numeric($bootosID)){
@@ -75,6 +76,10 @@ class ResourceController extends Zend_Controller_Action
public function getconfigAction()
{
+
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
$bootmenuentryID = $this->thisSession->getBootmenuentryID();
$bootmenuentry = new Application_Model_BootMenuEntries();
@@ -100,6 +105,10 @@ class ResourceController extends Zend_Controller_Action
public function getkernelAction()
{
+
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
$bootosID = $this->thisSession->getBootosID();
if(is_dir("../resources/bootos/$bootosID/kernel/") && is_numeric($bootosID)){
@@ -120,6 +129,9 @@ class ResourceController extends Zend_Controller_Action
public function getkclAction()
{
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
$bmeID = $this->thisSession->getBootmenuentryID();
if(is_numeric($bmeID)){
@@ -153,7 +165,8 @@ class ResourceController extends Zend_Controller_Action
// so getkclAction, getkernelAction, getconfigAction and getinitramfsAction
// can be called with session-identifier
- header('Content-Type: application/json');
+
+
$return_val =
array(
'info' => 'This function is for debugging purpose only',
@@ -163,13 +176,17 @@ class ResourceController extends Zend_Controller_Action
'config' => $this->thisSession->getAlphasessionID()
);
-
- $this->_redirect('/user/bootmenu/index/page/'.$this->page.'/json/'.json_encode($return_val));
+ $ser = serialize($return_val);
+ $this->_forward('index','bootmenu','user', array(
+ 'page' => $this->page,
+ 'json' => $ser
+ ));
}
private function generateURL($action, $varname, $varvalue, $filename){
+
$path = '/resource/'. $action .'/' . $varname .'/' . $varvalue .'/file/' . $filename ;
$path = "http://" . $_SERVER['SERVER_NAME'] . $path;
return $path;
diff --git a/library/Pbs/Notifier.php b/library/Pbs/Notifier.php
index 843b804..2d86748 100644
--- a/library/Pbs/Notifier.php
+++ b/library/Pbs/Notifier.php
@@ -123,8 +123,20 @@ class Pbs_Notifier{
break;
case "json":
switch($result){
- default:
- $result = "<div class='okbox'>$result</div>";
+ default:{
+ $result = unserialize($result);
+
+ $result2 = "<div class='infobox'>";
+ $result2 .= "<table class='json'>";
+ $result2 .= "<tr><td><b>info</b>: </td><td>".$result['info']."</td></tr>";
+ $result2 .= "<tr><td><b>kernel</b>: </td><td><a href=".$result['kernel'].">".$result['kernel']."<a></td></tr>";
+ $result2 .= "<tr><td><b>initramfs</b>: </td><td><a href=".$result['initramfs'].">".$result['initramfs']."<a></td></tr>";
+ $result2 .= "<tr><td><b>kcl</b>: </td><td><a href=".$result['kcl'].">".$result['kcl']."<a></td></tr>";
+ $result2 .= "<tr><td><b>config</b>: </td><td>".$result['config']."</td></tr>";
+ $result2 .= "</table>";
+ $result2 .= "</div>";
+ $result = $result2;
+ }
break;
case "forbidden":
$result = "<div class='errorbox'>Not allowed to display ressources</div>";
diff --git a/public/media/css/style.css b/public/media/css/style.css
index f71cf8b..dd89e41 100644
--- a/public/media/css/style.css
+++ b/public/media/css/style.css
@@ -480,4 +480,8 @@ td.action img {
cursor:default;
}
+table.json td {
+ border-style: none !important;
+}
+