Skip to content

Commit

Permalink
Begin The Project
Browse files Browse the repository at this point in the history
Adding the CMS to the repo.  getting started
  • Loading branch information
asecondwill committed Jun 12, 2012
1 parent a47860d commit f80ec35
Show file tree
Hide file tree
Showing 1,891 changed files with 283,391 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
28 changes: 28 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.

The Cake Software Foundation - promoting development related to CakePHP
http://cakefoundation.org/

CakePHP - the rapid development PHP framework
http://www.cakephp.org

Cookbook - user documentation for learning about CakePHP
http://book.cakephp.org

API - quick reference to CakePHP
http://api.cakephp.org

The Bakery - everything CakePHP
http://bakery.cakephp.org

The Show - live and archived podcasts about CakePHP and more
http://live.cakephp.org

CakePHP TV - screen casts from events and video tutorials
http://tv.cakephp.org

CakePHP Google Group - community mailing list and forum
http://groups.google.com/group/cake-php

#cakephp on irc.freenode.net - chat with CakePHP developers
irc://irc.freenode.net/cakephp
Binary file added Tractor/.DS_Store
Binary file not shown.
Binary file added Tractor/Config/.DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions Tractor/Config/database.php.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php


class DATABASE_CONFIG {

var $default = array(
'datasource' => '{default_datasource}',
'persistent' => false,
'host' => '{default_host}',
'login' => '{default_login}',
'password' => '{default_password}',
'database' => '{default_database}',
'prefix' => '{default_prefix}',
'encoding' => '{default_encoding}',
'port' => '{default_port}',
);

var $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
'encoding' => 'UTF8',
);
}
1 change: 1 addition & 0 deletions Tractor/Config/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
7 changes: 7 additions & 0 deletions Tractor/Config/tractor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/*
Default Tractor config. Override this stuff in app/Config/core.php
*/

//Configure::write('debug', 0);

Empty file.
Binary file added Tractor/Controller/.DS_Store
Binary file not shown.
142 changes: 142 additions & 0 deletions Tractor/Controller/BlocksController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?php
/*******************************************************************************************************
* Powered by tractor CMS. Copyright aSecondSystem.com
*
* Usage granted for one domain and website.
*
* Not for resale or distribution or any other use without permission from the authors.
*
********************************************************************************************************/
class BlocksController extends AppController {

var $name = 'Blocks';
var $paginate = array(
'limit' => 55,
'order' => array(
'Block.weight' => 'asc'
)
);

var $permissions = array(
'admin_index' => array('Editor'),
'admin_add' => array('Editor'),
'admin_edit' => array('Editor'),
'admin_delete' => array('Editor'),
'admin_order' => array('Editor'),
);

function beforeFilter() {
$this->Auth->allow('listing');

parent::beforeFilter();

}

function region( $region = null){

$conditions = array('Region.title' => $region);

$blocks = $this->Block->find('all', array('order' => 'Block.weight' , 'limit' => $limit, 'conditions' => $conditions));

return $blocks;
}

function admin_index($region_id = null) {
$this->Block->recursive = 0;
$filter= array();
if($region_id) {
$filter = array('region_id'=>$region_id);
$region = $this->Block->Region->findById($region_id);
$this->set('region', $region);
}
$this->set('blocks', $this->paginate($filter));

}



function admin_add($region = null) {
if (!empty($this->data)) {
$this->Block->create();
if ($this->Block->save($this->data)) {
$this->Session->setFlash(sprintf(__('The %s has been saved'), 'block'));
$this->redirect(array('action' => 'index', $this->data['Block']['region_id']));
} else {
$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.'), 'block'));
}
}
$regions = $this->Block->Region->find('list');
$this->set(compact('regions', 'region'));
}

function admin_edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(sprintf(__('Invalid %s'), 'block'));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Block->save($this->data)) {
$this->Session->setFlash(sprintf(__('The %s has been saved'), 'block'));
$this->redirect(array('action' => 'index', $this->data['Block']['region_id']));
} else {
$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.'), 'block'));
}
}
if (empty($this->data)) {
$this->data = $this->Block->read(null, $id);
}
$regions = $this->Block->Region->find('list');
$this->set(compact('regions'));
}

function admin_delete($id = null) {
if (!$id) {
$this->Session->setFlash(sprintf(__('Invalid id for %s'), 'block'));
$this->redirect(array('action'=>'index'));
}
if ($this->Block->delete($id)) {
$this->Session->setFlash(sprintf(__('%s deleted'), 'Block'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(sprintf(__('%s was not deleted'), 'Block'));
$this->redirect(array('action' => 'index'));
}

function admin_order(){


Configure::write('debug', 0);
$this->autoRender = false;

if($this->RequestHandler->isAjax()) {

$fields = explode('&', $_REQUEST['ids']);
$order = 0;

print_r($_REQUEST['ids']);
foreach($fields as $field)
{


$field_key_value = explode('=', $field);
$level = urldecode($field_key_value[0]);
$id = urldecode($field_key_value[1]);


// echo "**" . $id . "**";

if ($id){
$order++;


$data = array('Block'=>array('id'=>$id, 'weight'=>$order));
$this->Block->save($data);
}
}

// $this->Session->write('BeersInOurSession', $this->params['form']['id']);
}
}

}
?>
Loading

0 comments on commit f80ec35

Please sign in to comment.