Skip to content

Commit

Permalink
other files format.
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 6, 2010
1 parent 19efa7b commit e0d3391
Show file tree
Hide file tree
Showing 6 changed files with 707 additions and 800 deletions.
136 changes: 68 additions & 68 deletions app_controller.php
@@ -1,21 +1,21 @@
<?php
/**
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/

class AppController extends Controller {
var $helpers = array(
Expand All @@ -37,8 +37,8 @@ class AppController extends Controller {
);

/**
* actions where viewable will work.
*/
* actions where viewable will work.
*/
var $viewableActions = array(
'view'
);
Expand Down Expand Up @@ -89,22 +89,22 @@ function beforeFilter() {
}

/**
* Check the url is www.
*
* will redirect to www. if it is not set.
*
* @return true ;
*/
* Check the url is www.
*
* will redirect to www. if it is not set.
*
* @return true ;
*/
private function __checkUrl() {
}

/**
* Setup layout based on the prefix.
*
* Sets the layout to the corect var based on what path the user visits.
*
* @return bool true
*/
* Setup layout based on the prefix.
*
* Sets the layout to the corect var based on what path the user visits.
*
* @return bool true
*/
private function __setupLayout() {
$prefix = '';
if (isset($this->params['prefix'])) {
Expand Down Expand Up @@ -167,8 +167,8 @@ private function __setupCache() {
}

/**
* Common methods for the app
*/
* Common methods for the app
*/

protected function comment($id = null) {
if (!empty($this->data['Comment'])) {
Expand All @@ -181,7 +181,7 @@ protected function comment($id = null) {
if ($this->Post->createComment($id, $this->data)) {
$this->Session->setFlash(__($message, true));
$this->redirect(array('action' => 'view', $this->data[$this->modelClass]['id']));
}else {
} else {
$this->Session->setFlash(__('Your comment was not saved. Please check for errors and try again', true));
}
}
Expand All @@ -190,22 +190,22 @@ protected function comment($id = null) {
function __getClassName() {
if (isset($this->params['plugin'])) {
return Inflector::classify($this->params['plugin']) . '.' . Inflector::classify($this->name);
}else {
} else {
return Inflector::classify($this->name);
}
}

/**
* reorder records.
*
* uses named paramiters can use the following:
* - up: moves the record up.
* - down: moves the record down.
* - position: sets the position for the record.
*
* @param int $id the id of the record to move.
* @return does a redirect to the referer.
*/
* reorder records.
*
* uses named paramiters can use the following:
* - up: moves the record up.
* - down: moves the record down.
* - position: sets the position for the record.
*
* @param int $id the id of the record to move.
* @return does a redirect to the referer.
*/
protected function admin_reorder($id = null) {
$model = $this->modelNames[0];

Expand All @@ -226,9 +226,9 @@ protected function admin_reorder($id = null) {
switch ($this->params['named']['direction']) {
case 'position':
/**
*
* @todo set the position of the record after add
*/
*
* @todo set the position of the record after add
*/
break;

case 'up':
Expand All @@ -243,15 +243,15 @@ protected function admin_reorder($id = null) {
}

/**
* toggle records with an active table that is tinyint(1).
*
* @todo -c"AppController" Implement AppController.
* - check the table has "active" field
* - check its tinyint(1)
* - make better with saveField and not reading the whole record.
* @param mixed $id the id of the record
* @return n /a, redirects with different messages in {@see Session::setFlash}
*/
* toggle records with an active table that is tinyint(1).
*
* @todo -c"AppController" Implement AppController.
* - check the table has "active" field
* - check its tinyint(1)
* - make better with saveField and not reading the whole record.
* @param mixed $id the id of the record
* @return n /a, redirects with different messages in {@see Session::setFlash}
*/
protected function admin_toggle($id = null) {
$model = $this->modelNames[0];

Expand All @@ -275,18 +275,18 @@ protected function admin_toggle($id = null) {
}

/**
* delete records.
*
* delete records throughout the app.
*
* @todo -c"AppController" Implement AppController.
* - make a confirm if the js box does not happen. eg open delete in new
* window there is no confirm, just delete.
* - undo thing... maybe save the whole record in the session and if click
* undo just save it back, or use soft delete and purge
* @param mixed $id the id of the record.
* @return n /a just redirects with different messages in {@see Session::setFlash}
*/
* delete records.
*
* delete records throughout the app.
*
* @todo -c"AppController" Implement AppController.
* - make a confirm if the js box does not happen. eg open delete in new
* window there is no confirm, just delete.
* - undo thing... maybe save the whole record in the session and if click
* undo just save it back, or use soft delete and purge
* @param mixed $id the id of the record.
* @return n /a just redirects with different messages in {@see Session::setFlash}
*/
protected function admin_delete($id = null) {
$model = $this->modelNames[0];

Expand Down
86 changes: 43 additions & 43 deletions app_helper.php
@@ -1,21 +1,21 @@
<?php
/**
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/

class AppHelper extends Helper {
var $rowClassCounter = 0;
Expand All @@ -29,14 +29,14 @@ class AppHelper extends Helper {
var $helpers = array('Html', 'Design', 'Core.Wysiwyg', 'Core.Gravatar');

/**
* create some bread crumbs.
*
* Creates some bread crumbs.
*
* @todo -c"AppHelper" Implement AppHelper.
* - generate some links
* @param array $here is $this from the view.
*/
* create some bread crumbs.
*
* Creates some bread crumbs.
*
* @todo -c"AppHelper" Implement AppHelper.
* - generate some links
* @param array $here is $this from the view.
*/
function breadcrumbs($view = array(), $seperator = ' :: ') {
if (empty($view)) {
return false;
Expand All @@ -51,13 +51,13 @@ function breadcrumbs($view = array(), $seperator = ' :: ') {
}

/**
* switch the class for table rows
*
* @param integer $i the number of the row
* @param string $class1 class 1 highlight
* @param string $class2 class 2 highlight
* @return string the class
*/
* switch the class for table rows
*
* @param integer $i the number of the row
* @param string $class1 class 1 highlight
* @param string $class2 class 2 highlight
* @return string the class
*/
function rowClass($class1 = 'bg', $class2 = '') {
return (($this->rowClassCounter++ % 2) ? $class1 : $class2);
}
Expand All @@ -72,15 +72,15 @@ function adminPageHead($view) {
}

/**
* creates table headers for admin.
*
* if the format is just array( 'head1', 'head2' ... ) it will output a
* normal table with TH that have no classes/styles applied. you can
* also pass things like array ( 'head1' => array( 'class' => 'something' ) )
* to get out put like <th class="something">head1</th>
*
* @param array $data an array of items for the head.
*/
* creates table headers for admin.
*
* if the format is just array( 'head1', 'head2' ... ) it will output a
* normal table with TH that have no classes/styles applied. you can
* also pass things like array ( 'head1' => array( 'class' => 'something' ) )
* to get out put like <th class="something">head1</th>
*
* @param array $data an array of items for the head.
*/
function adminTableHeader($data) {
$out = '<tr>';
foreach($data as $field => $params) {
Expand All @@ -89,7 +89,7 @@ function adminTableHeader($data) {
if (is_int($field) && !is_array($params)) {
$field = $params;
$params = '';
}else {
} else {
foreach($params as $type => $param) {
$atributes = '';
$atributes .= $type . '="' . $param . '" ';
Expand All @@ -110,8 +110,8 @@ function adminTableHeader($data) {
}

/**
* creates the header images for the admin table headers.
*/
* creates the header images for the admin table headers.
*/
function adminTableHeadImages() {
return $this->Html->image(
'admin/bg-th-left.gif',
Expand Down

0 comments on commit e0d3391

Please sign in to comment.