Upgrade CakePHP from 2.2.5 to 2.9.5

This commit is contained in:
Brm Ko 2017-02-26 15:29:44 +01:00
parent 5a580df460
commit 235a541597
793 changed files with 60746 additions and 23753 deletions

View file

@ -0,0 +1,91 @@
/**
* index method
*
* @return void
*/
public function index() {
$this->BakeArticle->recursive = 0;
$this->set('bakeArticles', $this->Paginator->paginate());
}
/**
* view method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function view($id = null) {
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
$this->set('bakeArticle', $this->BakeArticle->find('first', $options));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->BakeArticle->create();
if ($this->BakeArticle->save($this->request->data)) {
$this->Flash->success(__('The bake article has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
}
}
$bakeTags = $this->BakeArticle->BakeTag->find('list');
$this->set(compact('bakeTags'));
}
/**
* edit method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function edit($id = null) {
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->BakeArticle->save($this->request->data)) {
$this->Flash->success(__('The bake article has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
}
} else {
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
$this->request->data = $this->BakeArticle->find('first', $options);
}
$bakeTags = $this->BakeArticle->BakeTag->find('list');
$this->set(compact('bakeTags'));
}
/**
* delete method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function delete($id = null) {
$this->BakeArticle->id = $id;
if (!$this->BakeArticle->exists()) {
throw new NotFoundException(__('Invalid bake article'));
}
$this->request->allowMethod('post', 'delete');
if ($this->BakeArticle->delete()) {
$this->Flash->success(__('The bake article has been deleted.'));
} else {
$this->Flash->error(__('The bake article could not be deleted. Please, try again.'));
}
return $this->redirect(array('action' => 'index'));
}

View file

@ -0,0 +1,84 @@
/**
* index method
*
* @return void
*/
public function index() {
$this->BakeArticle->recursive = 0;
$this->set('bakeArticles', $this->Paginator->paginate());
}
/**
* view method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function view($id = null) {
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
$this->set('bakeArticle', $this->BakeArticle->find('first', $options));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->BakeArticle->create();
if ($this->BakeArticle->save($this->request->data)) {
return $this->flash(__('The bake article has been saved.'), array('action' => 'index'));
}
}
$bakeTags = $this->BakeArticle->BakeTag->find('list');
$this->set(compact('bakeTags'));
}
/**
* edit method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function edit($id = null) {
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->BakeArticle->save($this->request->data)) {
return $this->flash(__('The bake article has been saved.'), array('action' => 'index'));
}
} else {
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
$this->request->data = $this->BakeArticle->find('first', $options);
}
$bakeTags = $this->BakeArticle->BakeTag->find('list');
$this->set(compact('bakeTags'));
}
/**
* delete method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function delete($id = null) {
$this->BakeArticle->id = $id;
if (!$this->BakeArticle->exists()) {
throw new NotFoundException(__('Invalid bake article'));
}
$this->request->allowMethod('post', 'delete');
if ($this->BakeArticle->delete()) {
return $this->flash(__('The bake article has been deleted.'), array('action' => 'index'));
} else {
return $this->flash(__('The bake article could not be deleted. Please, try again.'), array('action' => 'index'));
}
}

View file

@ -0,0 +1,27 @@
<?php
App::uses('AppController', 'Controller');
/**
* Articles Controller
*
* @property Article $Article
* @property AclComponent $Acl
* @property AuthComponent $Auth
* @property PaginatorComponent $Paginator
*/
class ArticlesController extends AppController {
/**
* Helpers
*
* @var array
*/
public $helpers = array('Js', 'Time');
/**
* Components
*
* @var array
*/
public $components = array('Acl', 'Auth', 'Paginator');
}

View file

@ -0,0 +1,18 @@
<?php
App::uses('AppController', 'Controller');
/**
* Articles Controller
*
* @property Article $Article
* @property PaginatorComponent $Paginator
*/
class ArticlesController extends AppController {
/**
* Components
*
* @var array
*/
public $components = array('Paginator');
}

View file

@ -0,0 +1,15 @@
<?php
App::uses('AppController', 'Controller');
/**
* Articles Controller
*/
class ArticlesController extends AppController {
/**
* Scaffold
*
* @var mixed
*/
public $scaffold;
}

View file

@ -0,0 +1,58 @@
<div class="viewTaskComments index">
<h2><?php echo __('View Task Comments'); ?></h2>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th><?php echo $this->Paginator->sort('id'); ?></th>
<th><?php echo $this->Paginator->sort('article_id'); ?></th>
<th><?php echo $this->Paginator->sort('user_id'); ?></th>
<th><?php echo $this->Paginator->sort('comment'); ?></th>
<th><?php echo $this->Paginator->sort('published'); ?></th>
<th><?php echo $this->Paginator->sort('created'); ?></th>
<th><?php echo $this->Paginator->sort('updated'); ?></th>
<th class="actions"><?php echo __('Actions'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($viewTaskComments as $viewTaskComment): ?>
<tr>
<td><?php echo h($viewTaskComment['ViewTaskComment']['id']); ?>&nbsp;</td>
<td>
<?php echo $this->Html->link($viewTaskComment['Article']['title'], array('controller' => 'view_task_articles', 'action' => 'view', $viewTaskComment['Article']['id'])); ?>
</td>
<td><?php echo h($viewTaskComment['ViewTaskComment']['user_id']); ?>&nbsp;</td>
<td><?php echo h($viewTaskComment['ViewTaskComment']['comment']); ?>&nbsp;</td>
<td><?php echo h($viewTaskComment['ViewTaskComment']['published']); ?>&nbsp;</td>
<td><?php echo h($viewTaskComment['ViewTaskComment']['created']); ?>&nbsp;</td>
<td><?php echo h($viewTaskComment['ViewTaskComment']['updated']); ?>&nbsp;</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $viewTaskComment['ViewTaskComment']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $viewTaskComment['ViewTaskComment']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $viewTaskComment['ViewTaskComment']['id']), array('confirm' => __('Are you sure you want to delete # %s?', $viewTaskComment['ViewTaskComment']['id']))); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?> </p>
<div class="paging">
<?php
echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
echo $this->Paginator->numbers(array('separator' => ''));
echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
?>
</div>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('New View Task Comment'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List View Task Articles'), array('controller' => 'view_task_articles', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Article'), array('controller' => 'view_task_articles', 'action' => 'add')); ?> </li>
</ul>
</div>