Example #1
0
 private function renderPage($sUrl)
 {
     // Build page object
     $oPage = new Page($sUrl, $this->sConfigFile);
     $oPage->build();
     // Get the theme
     $sTheme = $this->_oConfig->get('site', 'theme');
     $oTheme = new Theme($sTheme, $this->sConfigFile);
     // Add assets, blocks and config
     $oTheme->setPageConfig($oPage->getConfig());
     $oTheme->addBlocks($oPage->getBlocks());
     $oTheme->addAssets($oPage->getAssets());
     // Add page list for menus
     $sPath = $this->_oConfig->getPath('pages');
     $oFilesystem = new Filesystem();
     $aPageList = $oFilesystem->getAllPagesInDir($sPath, '', $this->sConfigFile);
     $oTheme->setSitemapInfo($this->determineUrl(), $aPageList, $oPage->getChildren());
     return $oTheme->renderPage();
 }
Example #2
0
 public function doGet(\Innomatic\Webapp\WebAppRequest $req, \Innomatic\Webapp\WebAppResponse $res)
 {
     // Start Innomatic
     $innomatic = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
     $innomatic->setInterface(\Innomatic\Core\InnomaticContainer::INTERFACE_EXTERNAL);
     $root = \Innomatic\Core\RootContainer::instance('\\Innomatic\\Core\\RootContainer');
     $innomatic_home = $root->getHome() . 'innomatic/';
     $innomatic->bootstrap($innomatic_home, $innomatic_home . 'core/conf/innomatic.ini');
     // Start Innomatic domain
     \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->startDomain(\Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getCurrentWebApp()->getName());
     // Innomedia page
     $scope_page = 'frontend';
     // Check if the page exists in the page tree
     $pageSearch = PageTree::findPageByPath(substr($req->getPathInfo(), 1));
     if ($pageSearch === false) {
         // This is a static page (excluding the home page).
         $location = explode('/', $req->getPathInfo());
         $module_name = isset($location[1]) ? $location[1] : '';
         $page_name = isset($location[2]) ? $location[2] : '';
         $pageId = isset($location[3]) ? $location[3] : 0;
     } else {
         // This is the home page or a content page.
         $module_name = $pageSearch['module'];
         $page_name = $pageSearch['page'];
         $pageId = $pageSearch['page_id'];
     }
     // Define Innomatic context
     $home = \Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getCurrentWebApp()->getHome();
     $context = Context::instance('\\Innomedia\\Context');
     $context->setRequest($req)->setResponse($res)->process();
     // Build Innomedia page
     $page = new Page($module_name, $page_name, $pageId, $scope_page);
     $page->parsePage();
     // Check if the page is valid
     if (!$page->isValid()) {
         $res->sendError(\Innomatic\Webapp\WebAppResponse::SC_NOT_FOUND, $req->getRequestURI());
     } else {
         $page->build();
     }
 }
Example #3
0
				print "RECCOMMENDED? INGREDIENTS:<br/>";
				foreach($ingredients as $ingredient)
				{
					print $ingredient['name']."<br/>";
					print $ingredient['isVegetarian'] ? "Vegetarian" : "";
					print $ingredient['isAllergenic'] ? "Allergy Warning" : "";
				}
				*/
			}
		}
		
	//print total
	$table_data = $table_data."<td>Total: ".$total."</td></tr>";
	}
	$tmpl->table_data = $table_data;
	
	$page->run();
	$html = $tmpl->build('orderlist.html');
	//$css = $tmpl->build('orderlist.css');
	//$js = $tmpl->build('orderlist.js');
	
	$appContent = array(
						'html'	=>	$html,
						'css'	=>	$css,
						'js' => $js
						);

	print $page->build($appContent);

?>
Example #4
0
		case 500:
				//Server Config or Script Crashed
				$tmpl->alert['type'] = "error";
				$tmpl->alert['message'] = "Oh jeez.  I'm so sorry.  I don't even know what happened.<br />I swear this doesn't usually happen.<br />...<br />Um, the server is broken.  Come back later.";
				break;
		case 200:
		default:
				//Server Config or Script Crashed
				$tmpl->alert['type'] = "okay";
				$tmpl->alert['message'] = "Oh, you think you're SO sneaky.  Move along, nothing to see here.";
				break;
	}

	$html = $tmpl->build('error.html');
	$css = $tmpl->build('error.css');
	$js = $tmpl->build('error.js');

	$appContent = array(
						'html'	=>	$html,
						'css'	=>	array(	'code' => $css,
											'link' => 'error'
											),
						'js' => array(	'code' => $js,
										'link' => 'error'
										)
						);

	echo $page->build($appContent);

?>
Example #5
0
    if ($item->name == 'id') {
        $pk = true;
    }
    $col[] = $item->name;
}
if ($pk) {
    $q = "SELECT * FROM " . $req->get('table') . " WHERE id = " . $req->get('id');
} else {
    $q = "SELECT * FROM " . $req->get('table') . " WHERE ROWID = " . $req->get('id');
}
$sql->qo($q);
$res = $sql->fo_one();
// var_dump($res);
$html = new Page();
$html->setLanguage('nl_NL');
$html->build();
$head = new Head();
$head->setCharset('UTF-8');
$head->setTitle('PSA - edit record');
$head->setCss('./css/psa.css');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
$form = new Form();
$form->setAction('controller.php');
$form->build();
$table = new Table();
$table->build();
$i = 0;
$inp = new Input();