Skip to content

Commit

Permalink
continued
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Nitzschner committed Oct 17, 2011
1 parent 60dd61d commit 784c458
Show file tree
Hide file tree
Showing 24 changed files with 6,429 additions and 147 deletions.
4 changes: 2 additions & 2 deletions app/app_controller.php 100755 → 100644
Expand Up @@ -33,7 +33,7 @@
*/ */
class AppController extends Controller { class AppController extends Controller {


var $helpers = array('Session', 'Html', 'Js'); var $helpers = array('Ajax', 'Session', 'Html', 'Js');
var $components = array('RequestHandler', 'Session', 'Auth', 'Cookie'); var $components = array('RequestHandler', 'Session', 'Auth', 'Cookie');


function beforeFilter() { function beforeFilter() {
Expand All @@ -46,7 +46,7 @@ function beforeFilter() {
$data = $this->getPayLoad(); $data = $this->getPayLoad();
if(!empty($data)) { if(!empty($data)) {
//$this->log('Payload', LOG_DEBUG); //$this->log('Payload', LOG_DEBUG);
$this->log($data, LOG_DEBUG); //$this->log($data, LOG_DEBUG);
$data = $this->object2Array($data); $data = $this->object2Array($data);
if(empty($data[$this->modelClass])) { if(empty($data[$this->modelClass])) {
$this->data[$this->modelClass] = $data; $this->data[$this->modelClass] = $data;
Expand Down
1 change: 0 additions & 1 deletion app/app_model.php
Expand Up @@ -31,5 +31,4 @@
* @subpackage cake.app * @subpackage cake.app
*/ */
class AppModel extends Model { class AppModel extends Model {

} }
11 changes: 0 additions & 11 deletions app/config/bootstrap.php
Expand Up @@ -55,14 +55,3 @@
if (!defined('SIMPLE_JSON')) { if (!defined('SIMPLE_JSON')) {
define('SIMPLE_JSON', '/elements/simple_json'); define('SIMPLE_JSON', '/elements/simple_json');
} }
define('OS_MS', 'Microsoft');
define('OS_UX', 'Unix');
define('NO_OS', 'None');
$sw = $_SERVER['SERVER_SOFTWARE'];
if(preg_match('/Microsoft/i', $sw)) {
define('OS', OS_MS);
} elseif (preg_match('/Unix/i', $sw)) {
define('OS', OS_UX);
} else {
define('OS', NO_OS);
}
3 changes: 2 additions & 1 deletion app/config/routes.php
Expand Up @@ -32,11 +32,12 @@
Router::connect('/q/*', array('controller' => 'kodaks', 'action' => 'develop')); Router::connect('/q/*', array('controller' => 'kodaks', 'action' => 'develop'));
Router::connect('/git/*', array('controller' => 'gits', 'action' => 'exec')); Router::connect('/git/*', array('controller' => 'gits', 'action' => 'exec'));
Router::connect('/mysql/*', array('controller' => 'mysql', 'action' => 'exec')); Router::connect('/mysql/*', array('controller' => 'mysql', 'action' => 'exec'));
Router::connect('/logout', array('controller' => 'users', 'action' => 'logout'));


/** /**
* ...and connect the rest of 'Pages' controller's urls. * ...and connect the rest of 'Pages' controller's urls.
*/ */
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));


Router::mapResources(array('todos', 'tasks', 'contacts' ,'users', 'galleries', 'albums', 'images')); Router::mapResources(array('todos', 'tasks', 'contacts' ,'users', 'galleries', 'albums', 'images'));
//Router::parseExtensions(); //Router::parseExtensions();
6 changes: 1 addition & 5 deletions app/controllers/albums_controller.php
Expand Up @@ -3,11 +3,9 @@
class AlbumsController extends AppController { class AlbumsController extends AppController {


var $name = 'Albums'; var $name = 'Albums';
var $helpers = array('Ajax', 'Js');
var $components = array('RequestHandler');


function beforeFilter() { function beforeFilter() {
$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete'); //$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete');
parent::beforeFilter(); parent::beforeFilter();
} }


Expand All @@ -26,7 +24,6 @@ function view($id = null) {
function add() { function add() {
if (!empty($this->data)) { if (!empty($this->data)) {
$this->Album->create(); $this->Album->create();
$this->log($this->data, LOG_DEBUG);
if ($this->Album->save($this->data)) { if ($this->Album->save($this->data)) {
$this->Session->setFlash(__('The album has been saved', true)); $this->Session->setFlash(__('The album has been saved', true));
} else { } else {
Expand All @@ -44,7 +41,6 @@ function edit($id = null) {
$this->redirect(array('action' => 'index')); $this->redirect(array('action' => 'index'));
} }
if (!empty($this->data)) { if (!empty($this->data)) {
$this->log($this->data, LOG_DEBUG);
if ($this->Album->save($this->data)) { if ($this->Album->save($this->data)) {
$this->Session->setFlash(__('The album has been saved', true)); $this->Session->setFlash(__('The album has been saved', true));
$this->redirect(array('action' => 'index')); $this->redirect(array('action' => 'index'));
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/director_app_controller.php
Expand Up @@ -4,13 +4,12 @@ class DirectorAppController extends AppController {


var $name = 'DirectorApp'; var $name = 'DirectorApp';
var $uses = array('Gallery', 'Album', 'Image'); var $uses = array('Gallery', 'Album', 'Image');
var $helpers = array('Js');


function beforeFilter() { function beforeFilter() {
Configure::write('debug', 0); Configure::write('debug', 0);
$this->autoRender = true; $this->autoRender = true;
$this->layout = 'director_layout'; $this->layout = 'director_layout';
$this->Auth->allowedActions = array('index'); //$this->Auth->allowedActions = array('index');
} }


function index() { function index() {
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/galleries_controller.php
Expand Up @@ -3,11 +3,9 @@
class GalleriesController extends AppController { class GalleriesController extends AppController {


var $name = 'Galleries'; var $name = 'Galleries';
var $helpers = array('Ajax', 'Js');
var $components = array('RequestHandler');


function beforeFilter() { function beforeFilter() {
$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete'); //$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete');
parent::beforeFilter(); parent::beforeFilter();
} }


Expand All @@ -26,8 +24,6 @@ function view($id = null) {


function add() { function add() {
if (!empty($this->data)) { if (!empty($this->data)) {
$this->log('Galleries::add', LOG_DEBUG);
$this->log($this->data, LOG_DEBUG);
$this->Gallery->create(); $this->Gallery->create();
if ($this->Gallery->save($this->data)) { if ($this->Gallery->save($this->data)) {
$this->Session->setFlash(__('The gallery has been saved', true)); $this->Session->setFlash(__('The gallery has been saved', true));
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/images_controller.php
Expand Up @@ -5,7 +5,7 @@ class ImagesController extends AppController {
var $name = 'Images'; var $name = 'Images';


function beforeFilter() { function beforeFilter() {
$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete'); //$this->Auth->allowedActions = array('index', 'view', 'add', 'edit', 'delete');
parent::beforeFilter(); parent::beforeFilter();
} }


Expand Down
Empty file modified app/controllers/pages_controller.php 100755 → 100644
Empty file.
14 changes: 8 additions & 6 deletions app/controllers/users_controller.php
Expand Up @@ -31,13 +31,15 @@ function login() {
} }


function logout() { function logout() {
if ($this->params['isAjax']) { $this->Auth->logout();
$this->Auth->logout(); if (!$this->params['isAjax']) {
$this->redirect(array('controller' => 'users', 'action' => 'login'));
} else {
$merged = array_merge($this->data['User'], array('id' => '', 'username' => '', 'name' => '', 'password' => '', 'sessionid' => '', 'flash' => '<strong>You\'re logged out successfully</strong>'));
$json = $merged;
$this->set(compact('json'));
$this->render(SIMPLE_JSON);
} }
$merged = array_merge($this->data['User'], array('id' => '', 'username' => '', 'name' => '', 'password' => '', 'sessionid' => '', 'flash' => '<strong>You\'re logged out successfully</strong>'));
$json = $merged;
$this->set(compact('json'));
$this->render(SIMPLE_JSON);
} }


function auth() { function auth() {
Expand Down
Empty file modified app/tmp/cache/models/empty 100644 → 100755
Empty file.
Empty file modified app/tmp/cache/persistent/empty 100644 → 100755
Empty file.
Empty file modified app/tmp/cache/views/empty 100644 → 100755
Empty file.
Empty file modified app/tmp/logs/empty 100644 → 100755
Empty file.
Empty file modified app/tmp/sessions/empty 100644 → 100755
Empty file.
51 changes: 33 additions & 18 deletions app/views/layouts/default.ctp
Expand Up @@ -19,22 +19,37 @@
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<?php echo $this->Html->charset(); ?> <?php echo $this->Html->charset(); ?>
<title> <title>
<?php __('CakePHP: Welcome to CakePHP: '); ?> <?php __('CakePHP: Welcome to CakePHP: '); ?>
<?php echo $title_for_layout; ?> <?php echo $title_for_layout; ?>
</title> </title>
<?php <?php
echo $this->Html->meta('icon'); echo $this->Html->meta('icon');

echo $this->Html->css('backbone/todos/application_boxmodel');
echo $this->Html->css('cake.generic');

//$this->log($js->object($galleries), LOG_DEBUG);
echo $scripts_for_layout; echo $this->Html->script('lib/jquery/jquery-1.6.2');
?> echo $this->Html->script('spine/lib/spine');
</head> echo $this->Html->script('spine/lib/ajax');
<body> echo $this->Html->script('spine/lib/filter');
<?php echo $content_for_layout; ?> echo $this->Html->script('spine/lib/filter');
<?php echo $this->element('sql_dump'); ?> echo $this->Html->script('spine/app/director/plugins/main_login');
</body>
echo $html->scriptStart();
?>

var base_url = '<?php echo $html->url('/'); ?>';

<?php
echo $html->scriptEnd();
echo $scripts_for_layout;

?>
</head>
<body>
<?php echo $content_for_layout; ?>
<?php echo $this->element('sql_dump'); ?>
</body>
</html> </html>
40 changes: 40 additions & 0 deletions app/views/layouts/default_original.ctp
@@ -0,0 +1,40 @@
<?php
/**
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.skel.views.layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $this->Html->charset(); ?>
<title>
<?php __('CakePHP: Welcome to CakePHP: '); ?>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $this->Html->meta('icon');

echo $this->Html->css('cake.generic');

echo $scripts_for_layout;
?>
</head>
<body>
<?php echo $content_for_layout; ?>
<?php echo $this->element('sql_dump'); ?>
</body>
</html>
2 changes: 0 additions & 2 deletions app/views/layouts/director_layout.ctp
Expand Up @@ -85,8 +85,6 @@
var galleries = <?php echo $js->object($galleries); ?>; var galleries = <?php echo $js->object($galleries); ?>;
var albums = <?php echo $js->object($albums); ?>; var albums = <?php echo $js->object($albums); ?>;
var images = <?php echo $js->object($images); ?>; var images = <?php echo $js->object($images); ?>;
//var galleries_album = <?php echo $js->object($galleries_album); ?>;
//var albums_image = <?php echo $js->object($albums_image); ?>;
Image.refresh(images); Image.refresh(images);
Album.refresh(albums); Album.refresh(albums);
Gallery.refresh(galleries); Gallery.refresh(galleries);
Expand Down
49 changes: 49 additions & 0 deletions app/views/users/login.ctp
@@ -0,0 +1,49 @@
<div style="" id="login">
<div id="messenger" class="dialogue-wrap transparent">
<div class="dialogue">
<?php echo $form->create('User', array('onsubmit' => 'new MainLogin({el:this}).submit(); return false; ')); ?>
<div id="morph_messenger-wrap" class="morph dialogue-content" style="width:525px; min-width:500px;">
<div id="draggable-messenger-wrap" class="bg verticaltop">
<header>
<fieldset class="right">
<button class="_close light window input">x</button>
</fieldset>
</header>
<div class="dialogue-inner-wrap">
<div class="drag-handle">
<div>
<h1>Login</h1>
<p class="_flash"><span>
Enter Username and Password
</span></p>
</div>
<div class="clearfix"></div>
</div>
<div class="dialogue-scroll">
<fieldset>
<div class="left">
<label>User</label>
<?php echo $form->input('username', array('label' => false, 'autofocus' => 'autofocus')); ?>
</div>
<div class="left">
<label>Password</label>
<?php echo $form->input('password', array('label' => false)); ?>
</div>
</fieldset>
</div>
</div>
<footer>
<span>
<fieldset>
<?php echo $this->Form->button('Login', array('type'=>'submit', 'class' => 'light')); ?>
</fieldset>
</span>
</footer>
</div>
</div>
</form>
</div>
</div>
</div>


22 changes: 20 additions & 2 deletions app/webroot/css/backbone/todos/application_boxmodel.css
Expand Up @@ -214,6 +214,24 @@ footer div#storage-mode span {
left: 10px; left: 10px;
position: relative; position: relative;
} }
#messenger footer {
-webkit-border-top-left-radius:0px ;
-webkit-border-top-right-radius:0px ;
-webkit-border-bottom-right-radius:8px ;
-webkit-border-bottom-left-radius:8px ;
-khtml-border-top-left-radius:0px ;
-khtml-border-top-right-radius:0px ;
-khtml-border-bottom-right-radius:8px ;
-khtml-border-bottom-left-radius:8px ;
-moz-border-radius-topleft:0px ;
-moz-border-radius-topright:0px ;
-moz-border-radius-bottomright:8px ;
-moz-border-radius-bottomleft:8px ;
border-top-left-radius:0px ;
border-top-right-radius:0px ;
border-bottom-right-radius:8px ;
border-bottom-left-radius:8px ;
}
.right { .right {
float: right; float: right;
} }
Expand Down Expand Up @@ -567,9 +585,9 @@ div.bg div {
margin: 9px; margin: 9px;
} }
div.dialogue-content div.bg { div.dialogue-content div.bg {
-moz-border-radius: 0; -moz-border-radius: 8px;
-webkit-border-radius: 8px;
-moz-box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.6); -moz-box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.6);
-webkit-border-radius: 0;
-webkit-box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.6); -webkit-box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.6);
background: none repeat scroll 0 0 #E3E3E3; background: none repeat scroll 0 0 #E3E3E3;
float: left; float: left;
Expand Down

0 comments on commit 784c458

Please sign in to comment.