Permalink
Browse files

Added common application

  • Loading branch information...
1 parent 921981e commit bdd0f797683e663f3b8f678913b75ca09d2d74be @Artazor Artazor committed May 10, 2012
@@ -0,0 +1,25 @@
+<?
+
+ class Oxygen_Common_Application extends Oxygen_ScopeController {
+
+ public $auth;
+ public $config;
+
+ public function __complete() {
+ $this->auth = $this->scope->__authenticated();
+ }
+
+ public function configure($x) {
+ $x['public']->Dummy('Public page');
+ switch($this->auth->role) {
+ case 'admin':
+ $x['files']->Dummy('Files','folder_explore');
+ case 'user':
+ $x['users']->Dummy('Users','user');
+ default:
+ $x['{url:any}']->LogonPage('login');
+ }
+ }
+ }
+
+?>
@@ -0,0 +1,7 @@
+<div class="oxy-content">
+ <?if($this->child):?>
+ <?$this->child->put_view()?>
+ <?else:?>
+ <?$this->put_tiled()?>
+ <?endif?>
+</div>
@@ -0,0 +1 @@
+YourCompany, <?=date('Y')?>
@@ -0,0 +1,3 @@
+<div class="oxy-footer">
+ <div class="copy">&copy; <?$this->put_copyright()?></div>
+</div>
@@ -0,0 +1,12 @@
+<div class="oxy-header">
+ <?$this->put_logo()?>
+ <h1><?$this->getCurrent()->put_title()?></h1>
+ <ul class="bread-crumbs">
+ <?$breadCrumbs = $this->getPathToCurrent()?>
+ <?array_pop($breadCrumbs)?>
+ <?foreach($breadCrumbs as $child):?>
+ <li><?=$child?></li>
+ <?endforeach?>
+ </ul>
+ <?$this->put_login()?>
+</div>
@@ -0,0 +1,14 @@
+<form class="logon-form" action="<?=$this->go('login')?>" method="POST">
+ <?$auth = $this->scope->auth?>
+ <?if($auth->role):?>
+ <span class="user"><?=$auth->login?></span> is logged as
+ <select class="role">
+ <?foreach($auth->roles as $role):?>
+ <option><?=$role?></option>
+ <?endforeach?>
+ </select>
+ <input type="submit" name="sign-out" value="Sign-Out"/>
+ <?else:?>
+ <span class="message">You are not signed in</span>
+ <?endif?>
+</form>
@@ -0,0 +1,5 @@
+<?if(!$this->isCurrent):?>
+ <a href="<?=$this->go()?>" class="user-logo"></a>
+<?else:?>
+ <span class="user-logo"></span>
+<?endif?>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,30 @@
+<div class="oxy-menu">
+ <ul class="first-level">
+ <?foreach($this as $child):?>
+ <?if($child->isActive):?>
+ <li class="expanded">
+ <a class="title" href="<?=$child->go()?>"><?$child->put_icon()?><?=$child?></a>
+ <?if(count($child)>0):?>
+ <ul class="second-level">
+ <?foreach($child as $subchild):?>
+ <?if($subchild->isActive):?>
+ <li class="expanded">
+ <a class="title" href="<?=$subchild->go()?>"><?$subchild->put_icon()?><?=$subchild?></a>
+ </li>
+ <?else:?>
+ <li class="collapsed">
+ <a class="title" href="<?=$subchild->go()?>"><?$subchild->put_icon()?><?=$subchild?></a>
+ </li>
+ <?endif?>
+ <?endforeach?>
+ </ul>
+ <?endif?>
+ </li>
+ <?else:?>
+ <li class="collapsed">
+ <a class="title" href="<?=$child->go()?>"><?$child->put_icon()?><?=$child?></a>
+ </li>
+ <?endif?>
+ <?endforeach?>
+ </ul>
+</div>
@@ -0,0 +1 @@
+Oxygen Common Application
@@ -0,0 +1,65 @@
+html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var, b, u, i, center,
+dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table td, table th {
+ vertical-align: middle;
+}
+
+html, body {
+ height: 100%;
+}
+
+div.oxy-footer {
+ position: relative;
+ float: left;
+ width: 100%;
+ min-height: 50px;
+ margin-top: -51px;
+ background-color: #FFF;
+ box-shadow: inset 0px 20px 40px #EEE;
+ border-top: 1px solid #CCC;
+ text-align: center;
+}
+
+div.oxy-footer div.copy {
+ margin: 20px auto;
+ font-family: Verdana;
+ font-size: 10px;
+ color: #888;
+
+}
+
View
@@ -0,0 +1,11 @@
+var $document = $(document)
+ , $content = $('div.oxy-content')
+ , $menu = $('div.oxy-menu')
+ , $header = $('div.oxy-header')
+ , $footer = $('div.oxy-footer')
+ ;
+
+clientHeight = $document.height()-$header.height()-$footer.height();
+$content.height(clientHeight);
+$menu.height(clientHeight);
+
Oops, something went wrong.

0 comments on commit bdd0f79

Please sign in to comment.