code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
<div class="jobs form">
<?php echo $this->Form->create('Job');?>
<fieldset>
<legend><?php echo __('Add Job'); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('description');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Jobs'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Bids'), array('controller' => 'bids', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Bid'), array('controller' => 'bids', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Jobs/add.ctp | PHP | gpl3 | 961 |
<div class="jobs index">
<h2><?php echo __('Jobs');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('description');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($jobs as $job): ?>
<tr>
<td><?php echo h($job['Job']['id']); ?> </td>
<td><?php echo h($job['Job']['name']); ?> </td>
<td><?php echo h($job['Job']['description']); ?> </td>
<td>
<?php echo $this->Html->link($job['User']['name'], array('controller' => 'users', 'action' => 'view', $job['User']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $job['Job']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $job['Job']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $job['Job']['id']), null, __('Are you sure you want to delete # %s?', $job['Job']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Job'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Bids'), array('controller' => 'bids', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Bid'), array('controller' => 'bids', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Jobs/index.ctp | PHP | gpl3 | 2,391 |
<div class="jobs view">
<h2><?php echo __('Job');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($job['Job']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($job['Job']['name']); ?>
</dd>
<dt><?php echo __('Description'); ?></dt>
<dd>
<?php echo h($job['Job']['description']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($job['User']['name'], array('controller' => 'users', 'action' => 'view', $job['User']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Job'), array('action' => 'edit', $job['Job']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Job'), array('action' => 'delete', $job['Job']['id']), null, __('Are you sure you want to delete # %s?', $job['Job']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Jobs'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Job'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Bids'), array('controller' => 'bids', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Bid'), array('controller' => 'bids', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Bids');?></h3>
<?php if (!empty($job['Bid'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Job Id'); ?></th>
<th><?php echo __('User Id'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($job['Bid'] as $bid): ?>
<tr>
<td><?php echo $bid['id'];?></td>
<td><?php echo $bid['job_id'];?></td>
<td><?php echo $bid['user_id'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'bids', 'action' => 'view', $bid['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'bids', 'action' => 'edit', $bid['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'bids', 'action' => 'delete', $bid['id']), null, __('Are you sure you want to delete # %s?', $bid['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Bid'), array('controller' => 'bids', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Jobs/view.ctp | PHP | gpl3 | 2,828 |
<div class="jobs form">
<?php echo $this->Form->create('Job');?>
<fieldset>
<legend><?php echo __('Edit Job'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('description');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Job.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Job.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Jobs'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Bids'), array('controller' => 'bids', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Bid'), array('controller' => 'bids', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Jobs/edit.ctp | PHP | gpl3 | 1,199 |
<div class="posts" id="post">
<?php echo $this->Form->create('Post');?>
<fieldset>
<legend><?php echo __('Add Post'); ?></legend>
<?php
echo $this->Form->input('text');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php
echo $ajax->submit('Submit', array('url'=> array('controller'=>'photos', 'action'=>'add'), 'update' => 'post'));
echo $this->Form->end();?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Posts'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Comments'), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Comment'), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Posts/add.ctp | PHP | gpl3 | 1,047 |
<div class="posts index">
<h2><?php echo __('Posts');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('text');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($posts as $post): ?>
<tr>
<td><?php echo h($post['Post']['id']); ?> </td>
<td><?php echo h($post['Post']['text']); ?> </td>
<td>
<?php echo $this->Html->link($post['User']['name'], array('controller' => 'users', 'action' => 'view', $post['User']['id'])); ?>
</td>
<td><?php echo h($post['Post']['created']); ?> </td>
<td><?php echo h($post['Post']['modified']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $post['Post']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $post['Post']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $post['Post']['id']), null, __('Are you sure you want to delete # %s?', $post['Post']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Post'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Comments'), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Comment'), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Posts/index.ctp | PHP | gpl3 | 2,544 |
<div class="posts view">
<h2><?php echo __('Post');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($post['Post']['id']); ?>
</dd>
<dt><?php echo __('Text'); ?></dt>
<dd>
<?php echo h($post['Post']['text']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($post['User']['name'], array('controller' => 'users', 'action' => 'view', $post['User']['id'])); ?>
</dd>
<dt><?php echo __('Created'); ?></dt>
<dd>
<?php echo h($post['Post']['created']); ?>
</dd>
<dt><?php echo __('Modified'); ?></dt>
<dd>
<?php echo h($post['Post']['modified']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Post'), array('action' => 'edit', $post['Post']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Post'), array('action' => 'delete', $post['Post']['id']), null, __('Are you sure you want to delete # %s?', $post['Post']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Comments'), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Comment'), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Comments');?></h3>
<?php if (!empty($post['Comment'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Text'); ?></th>
<th><?php echo __('User Id'); ?></th>
<th><?php echo __('Post Id'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($post['Comment'] as $comment): ?>
<tr>
<td><?php echo $comment['id'];?></td>
<td><?php echo $comment['text'];?></td>
<td><?php echo $comment['user_id'];?></td>
<td><?php echo $comment['post_id'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'comments', 'action' => 'view', $comment['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'comments', 'action' => 'edit', $comment['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'comments', 'action' => 'delete', $comment['id']), null, __('Are you sure you want to delete # %s?', $comment['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Comment'), array('controller' => 'comments', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Posts/view.ctp | PHP | gpl3 | 3,124 |
<div class="posts form">
<?php echo $this->Form->create('Post');?>
<fieldset>
<legend><?php echo __('Edit Post'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('text');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Post.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Post.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Posts'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Comments'), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Comment'), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Posts/edit.ctp | PHP | gpl3 | 1,178 |
<div class="comments form">
<?php echo $this->Form->create('Comment');?>
<fieldset>
<legend><?php echo __('Add Comment'); ?></legend>
<?php
echo $this->Form->input('text');
echo $this->Form->input('user_id');
echo $this->Form->input('post_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Comments'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'), array('controller' => 'posts', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('controller' => 'posts', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Comments/add.ctp | PHP | gpl3 | 977 |
<div class="comments index">
<h2><?php echo __('Comments');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('text');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th><?php echo $this->Paginator->sort('post_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($comments as $comment): ?>
<tr>
<td><?php echo h($comment['Comment']['id']); ?> </td>
<td><?php echo h($comment['Comment']['text']); ?> </td>
<td>
<?php echo $this->Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($comment['Post']['id'], array('controller' => 'posts', 'action' => 'view', $comment['Post']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $comment['Comment']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $comment['Comment']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $comment['Comment']['id']), null, __('Are you sure you want to delete # %s?', $comment['Comment']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Comment'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'), array('controller' => 'posts', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('controller' => 'posts', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Comments/index.ctp | PHP | gpl3 | 2,558 |
<div class="comments view">
<h2><?php echo __('Comment');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($comment['Comment']['id']); ?>
</dd>
<dt><?php echo __('Text'); ?></dt>
<dd>
<?php echo h($comment['Comment']['text']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?>
</dd>
<dt><?php echo __('Post'); ?></dt>
<dd>
<?php echo $this->Html->link($comment['Post']['id'], array('controller' => 'posts', 'action' => 'view', $comment['Post']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Comment'), array('action' => 'edit', $comment['Comment']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Comment'), array('action' => 'delete', $comment['Comment']['id']), null, __('Are you sure you want to delete # %s?', $comment['Comment']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Comments'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Comment'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'), array('controller' => 'posts', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('controller' => 'posts', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Comments/view.ctp | PHP | gpl3 | 1,785 |
<div class="comments form">
<?php echo $this->Form->create('Comment');?>
<fieldset>
<legend><?php echo __('Edit Comment'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('text');
echo $this->Form->input('user_id');
echo $this->Form->input('post_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Comment.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Comment.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Comments'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'), array('controller' => 'posts', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('controller' => 'posts', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Comments/edit.ctp | PHP | gpl3 | 1,223 |
<div class="messages form">
<?php echo $this->Form->create('Message');?>
<fieldset>
<legend><?php echo __('Add Message'); ?></legend>
<?php
echo $this->Form->input('text');
echo $this->Form->input('stat');
echo $this->Form->input('user_id');
echo $this->Form->input('User');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Messages'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Messages/add.ctp | PHP | gpl3 | 780 |
<div class="messages index">
<h2><?php echo __('Messages');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('text');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th><?php echo $this->Paginator->sort('stat');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($messages as $message): ?>
<tr>
<td><?php echo h($message['Message']['id']); ?> </td>
<td><?php echo h($message['Message']['text']); ?> </td>
<td><?php echo h($message['Message']['created']); ?> </td>
<td><?php echo h($message['Message']['modified']); ?> </td>
<td><?php echo h($message['Message']['stat']); ?> </td>
<td>
<?php echo $this->Html->link($message['User']['name'], array('controller' => 'users', 'action' => 'view', $message['User']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $message['Message']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $message['Message']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $message['Message']['id']), null, __('Are you sure you want to delete # %s?', $message['Message']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Message'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Messages/index.ctp | PHP | gpl3 | 2,493 |
<div class="messages view">
<h2><?php echo __('Message');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($message['Message']['id']); ?>
</dd>
<dt><?php echo __('Text'); ?></dt>
<dd>
<?php echo h($message['Message']['text']); ?>
</dd>
<dt><?php echo __('Created'); ?></dt>
<dd>
<?php echo h($message['Message']['created']); ?>
</dd>
<dt><?php echo __('Modified'); ?></dt>
<dd>
<?php echo h($message['Message']['modified']); ?>
</dd>
<dt><?php echo __('Stat'); ?></dt>
<dd>
<?php echo h($message['Message']['stat']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($message['User']['name'], array('controller' => 'users', 'action' => 'view', $message['User']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Message'), array('action' => 'edit', $message['Message']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Message'), array('action' => 'delete', $message['Message']['id']), null, __('Are you sure you want to delete # %s?', $message['Message']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Messages'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Message'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Users');?></h3>
<?php if (!empty($message['User'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Name'); ?></th>
<th><?php echo __('Password'); ?></th>
<th><?php echo __('Mobile'); ?></th>
<th><?php echo __('Email'); ?></th>
<th><?php echo __('Code'); ?></th>
<th><?php echo __('Status'); ?></th>
<th><?php echo __('Created'); ?></th>
<th><?php echo __('Modified'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($message['User'] as $user): ?>
<tr>
<td><?php echo $user['id'];?></td>
<td><?php echo $user['name'];?></td>
<td><?php echo $user['password'];?></td>
<td><?php echo $user['mobile'];?></td>
<td><?php echo $user['email'];?></td>
<td><?php echo $user['code'];?></td>
<td><?php echo $user['status'];?></td>
<td><?php echo $user['created'];?></td>
<td><?php echo $user['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'users', 'action' => 'delete', $user['id']), null, __('Are you sure you want to delete # %s?', $user['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Messages/view.ctp | PHP | gpl3 | 3,434 |
<div class="messages form">
<?php echo $this->Form->create('Message');?>
<fieldset>
<legend><?php echo __('Edit Message'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('text');
echo $this->Form->input('stat');
echo $this->Form->input('user_id');
echo $this->Form->input('User');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Message.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Message.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Messages'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Messages/edit.ctp | PHP | gpl3 | 1,026 |
<div class="educations form">
<?php echo $this->Form->create('Education');?>
<fieldset>
<legend><?php echo __('Add Education'); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('start');
echo $this->Form->input('end');
echo $this->Form->input('user_id');
echo $this->Form->input('edu_type_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Educations'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('controller' => 'edu_types', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Edu Type'), array('controller' => 'edu_types', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Educations/add.ctp | PHP | gpl3 | 1,077 |
<div class="educations index">
<h2><?php echo __('Educations');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('start');?></th>
<th><?php echo $this->Paginator->sort('end');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th><?php echo $this->Paginator->sort('edu_type_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($educations as $education): ?>
<tr>
<td><?php echo h($education['Education']['id']); ?> </td>
<td><?php echo h($education['Education']['name']); ?> </td>
<td><?php echo h($education['Education']['start']); ?> </td>
<td><?php echo h($education['Education']['end']); ?> </td>
<td>
<?php echo $this->Html->link($education['User']['name'], array('controller' => 'users', 'action' => 'view', $education['User']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($education['EduType']['name'], array('controller' => 'edu_types', 'action' => 'view', $education['EduType']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $education['Education']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $education['Education']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $education['Education']['id']), null, __('Are you sure you want to delete # %s?', $education['Education']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Education'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('controller' => 'edu_types', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Edu Type'), array('controller' => 'edu_types', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Educations/index.ctp | PHP | gpl3 | 2,884 |
<div class="educations view">
<h2><?php echo __('Education');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($education['Education']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($education['Education']['name']); ?>
</dd>
<dt><?php echo __('Start'); ?></dt>
<dd>
<?php echo h($education['Education']['start']); ?>
</dd>
<dt><?php echo __('End'); ?></dt>
<dd>
<?php echo h($education['Education']['end']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($education['User']['name'], array('controller' => 'users', 'action' => 'view', $education['User']['id'])); ?>
</dd>
<dt><?php echo __('Edu Type'); ?></dt>
<dd>
<?php echo $this->Html->link($education['EduType']['name'], array('controller' => 'edu_types', 'action' => 'view', $education['EduType']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Education'), array('action' => 'edit', $education['Education']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Education'), array('action' => 'delete', $education['Education']['id']), null, __('Are you sure you want to delete # %s?', $education['Education']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Educations'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Education'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('controller' => 'edu_types', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Edu Type'), array('controller' => 'edu_types', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Educations/view.ctp | PHP | gpl3 | 2,097 |
<div class="educations form">
<?php echo $this->Form->create('Education');?>
<fieldset>
<legend><?php echo __('Edit Education'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('start');
echo $this->Form->input('end');
echo $this->Form->input('user_id');
echo $this->Form->input('edu_type_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Education.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Education.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Educations'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('controller' => 'edu_types', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Edu Type'), array('controller' => 'edu_types', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Educations/edit.ctp | PHP | gpl3 | 1,327 |
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php echo __('Add Language'); ?></legend>
<?php
echo $this->Form->input('source_id');
echo $this->Form->input('destination_id');
echo $this->Form->input('User');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Languages'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Sources'), array('controller' => 'sources', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Source'), array('controller' => 'sources', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Destinations'), array('controller' => 'destinations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Destination'), array('controller' => 'destinations', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Languages/add.ctp | PHP | gpl3 | 1,256 |
<div class="languages index">
<h2><?php echo __('Languages');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('source_id');?></th>
<th><?php echo $this->Paginator->sort('destination_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($languages as $language): ?>
<tr>
<td><?php echo h($language['Language']['id']); ?> </td>
<td>
<?php echo $this->Html->link($language['Source']['name'], array('controller' => 'sources', 'action' => 'view', $language['Source']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($language['Destination']['name'], array('controller' => 'destinations', 'action' => 'view', $language['Destination']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $language['Language']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $language['Language']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $language['Language']['id']), null, __('Are you sure you want to delete # %s?', $language['Language']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Language'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Sources'), array('controller' => 'sources', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Source'), array('controller' => 'sources', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Destinations'), array('controller' => 'destinations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Destination'), array('controller' => 'destinations', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Languages/index.ctp | PHP | gpl3 | 2,759 |
<div class="languages view">
<h2><?php echo __('Language');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($language['Language']['id']); ?>
</dd>
<dt><?php echo __('Source'); ?></dt>
<dd>
<?php echo $this->Html->link($language['Source']['name'], array('controller' => 'sources', 'action' => 'view', $language['Source']['id'])); ?>
</dd>
<dt><?php echo __('Destination'); ?></dt>
<dd>
<?php echo $this->Html->link($language['Destination']['name'], array('controller' => 'destinations', 'action' => 'view', $language['Destination']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Language'), array('action' => 'edit', $language['Language']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Language'), array('action' => 'delete', $language['Language']['id']), null, __('Are you sure you want to delete # %s?', $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Languages'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Sources'), array('controller' => 'sources', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Source'), array('controller' => 'sources', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Destinations'), array('controller' => 'destinations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Destination'), array('controller' => 'destinations', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Users');?></h3>
<?php if (!empty($language['User'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Name'); ?></th>
<th><?php echo __('Password'); ?></th>
<th><?php echo __('Mobile'); ?></th>
<th><?php echo __('Email'); ?></th>
<th><?php echo __('Code'); ?></th>
<th><?php echo __('Status'); ?></th>
<th><?php echo __('Created'); ?></th>
<th><?php echo __('Modified'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($language['User'] as $user): ?>
<tr>
<td><?php echo $user['id'];?></td>
<td><?php echo $user['name'];?></td>
<td><?php echo $user['password'];?></td>
<td><?php echo $user['mobile'];?></td>
<td><?php echo $user['email'];?></td>
<td><?php echo $user['code'];?></td>
<td><?php echo $user['status'];?></td>
<td><?php echo $user['created'];?></td>
<td><?php echo $user['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'users', 'action' => 'delete', $user['id']), null, __('Are you sure you want to delete # %s?', $user['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Languages/view.ctp | PHP | gpl3 | 3,713 |
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php echo __('Edit Language'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('source_id');
echo $this->Form->input('destination_id');
echo $this->Form->input('User');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Language.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Language.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Sources'), array('controller' => 'sources', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Source'), array('controller' => 'sources', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Destinations'), array('controller' => 'destinations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Destination'), array('controller' => 'destinations', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Languages/edit.ctp | PHP | gpl3 | 1,504 |
<iframe src="http://cakephp.org/bake-banner" width="830" height="160" style="overflow:hidden; border:none;">
<p>For updates and important announcements, visit http://cakefest.org</p>
</iframe>
<h2>Sweet, "7010" got Baked by CakePHP!</h2>
<?php
App::uses('Debugger', 'Utility');
if (Configure::read('debug') > 0):
Debugger::checkSecurityKeys();
endif;
?>
<p>
<?php
if (version_compare(PHP_VERSION, '5.2.6', '>=')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your version of PHP is 5.2.6 or higher.');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.6 or higher to use CakePHP.');
echo '</span>';
endif;
?>
</p>
<p>
<?php
if (is_writable(TMP)):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your tmp directory is writable.');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your tmp directory is NOT writable.');
echo '</span>';
endif;
?>
</p>
<p>
<?php
$settings = Cache::settings();
if (!empty($settings)):
echo '<span class="notice success">';
echo __d('cake_dev', 'The %s is being used for caching. To change the config edit APP/Config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/Config/core.php');
echo '</span>';
endif;
?>
</p>
<p>
<?php
$filePresent = null;
if (file_exists(APP . 'Config' . DS . 'database.php')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your database configuration file is present.');
$filePresent = true;
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your database configuration file is NOT present.');
echo '<br/>';
echo __d('cake_dev', 'Rename APP/Config/database.php.default to APP/Config/database.php');
echo '</span>';
endif;
?>
</p>
<?php
if (isset($filePresent)):
App::uses('ConnectionManager', 'Model');
try {
$connected = ConnectionManager::getDataSource('default');
} catch (Exception $e) {
$connected = false;
}
?>
<p>
<?php
if ($connected && $connected->isConnected()):
echo '<span class="notice success">';
echo __d('cake_dev', 'Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</p>
<?php endif;?>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class="notice">';
__d('cake_dev', 'PCRE has not been compiled with Unicode support.');
echo '<br/>';
__d('cake_dev', 'Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo '</span></p>';
}
?>
<h3><?php echo __d('cake_dev', 'Editing this Page'); ?></h3>
<p>
<?php
echo __d('cake_dev', 'To change the content of this page, edit: %s
To change its layout, edit: %s
You can also add some CSS styles for your pages at: %s',
APP . 'View' . DS . 'Pages' . DS . 'home.ctp.<br />', APP . 'View' . DS . 'Layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');
?>
</p>
| 0001-bee | trunk/cakephp2/app/View/Pages/home.ctp | PHP | gpl3 | 3,387 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php
$content = explode("\n", $content);
foreach ($content as $line):
echo '<p> ' . $line . '</p>';
endforeach;
?> | 0001-bee | trunk/cakephp2/app/View/Emails/html/default.ctp | PHP | gpl3 | 727 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Emails.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content; ?> | 0001-bee | trunk/cakephp2/app/View/Emails/text/default.ctp | PHP | gpl3 | 633 |
<?php echo $scripts_for_layout; ?>
<script type="text/javascript"><?php echo $content_for_layout; ?></script> | 0001-bee | trunk/cakephp2/app/View/Layouts/js/default.ctp | PHP | gpl3 | 109 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content_for_layout; ?> | 0001-bee | trunk/cakephp2/app/View/Layouts/ajax.ctp | PHP | gpl3 | 640 |
<?php echo $xml->header(); ?>
<?php echo $content_for_layout; ?> | 0001-bee | trunk/cakephp2/app/View/Layouts/xml/default.ctp | PHP | gpl3 | 64 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.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 echo $page_title; ?></title>
<?php if (Configure::read('debug') == 0) { ?>
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
<?php } ?>
<style><!--
P { text-align:center; font:bold 1.1em sans-serif }
A { color:#444; text-decoration:none }
A:HOVER { text-decoration: underline; color:#44E }
--></style>
</head>
<body>
<p><a href="<?php echo $url?>"><?php echo $message?></a></p>
</body>
</html> | 0001-bee | trunk/cakephp2/app/View/Layouts/flash.ctp | PHP | gpl3 | 1,255 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.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 echo __('CakePHP: the rapid development php framework:'); ?>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $this->Html->meta('icon');
echo $this->Html->css('main');
echo $this->Html->css('reset');
echo $this->Html->css('text');
echo $this->Html->css('960');
echo $this->Html->css('ui-lightness/jquery-ui-1.8.16.custom');
echo $this->Html->script('jquery.min');
echo $this->Html->script('jquery-ui.custom.min');
echo $this->Html->script('jquery.autocomplete.min');
echo $this->Html->script('jquery.jeditable.mini');
echo $scripts_for_layout;
?>
</head>
<body>
<div id="container" class="container_12 ui-corner-all">
<div id="header" class="grid_12">
<h1><?php echo $this->Html->link(__('CakePHP: the rapid development php framework'), 'http://cakephp.org'); ?></h1>
</div>
<div class="clear"></div>
<div class="grid_12 content ui-corner-all">
<?php echo $this->Session->flash(); ?>
<?php echo $content_for_layout; ?>
</div>
<div id="footer" class="grid_12">
<?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework'), 'border' => '0')),
'http://www.cakephp.org/',
array('target' => '_blank', 'escape' => false)
);
?>
</div>
</div>
<?php echo $this->element('sql_dump'); ?>
</body>
</html> | 0001-bee | trunk/cakephp2/app/View/Layouts/default.ctp | PHP | gpl3 | 2,485 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Layouts.Email.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title><?php echo $title_for_layout;?></title>
</head>
<body>
<?php echo $content_for_layout;?>
<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>
</body>
</html> | 0001-bee | trunk/cakephp2/app/View/Layouts/Emails/html/default.ctp | PHP | gpl3 | 887 |
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Layouts.Email.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content_for_layout;?>
This email was sent using the CakePHP Framework, http://cakephp.org.
| 0001-bee | trunk/cakephp2/app/View/Layouts/Emails/text/default.ctp | PHP | gpl3 | 722 |
<?php
echo $rss->header();
if (!isset($channel)) {
$channel = array();
}
if (!isset($channel['title'])) {
$channel['title'] = $title_for_layout;
}
echo $rss->document(
$rss->channel(
array(), $channel, $content_for_layout
)
);
?> | 0001-bee | trunk/cakephp2/app/View/Layouts/rss/default.ctp | PHP | gpl3 | 238 |
<div class="sources form">
<?php echo $this->Form->create('Source');?>
<fieldset>
<legend><?php echo __('Add Source'); ?></legend>
<?php
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Sources'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Sources/add.ctp | PHP | gpl3 | 681 |
<div class="sources index">
<h2><?php echo __('Sources');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($sources as $source): ?>
<tr>
<td><?php echo h($source['Source']['id']); ?> </td>
<td><?php echo h($source['Source']['name']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $source['Source']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $source['Source']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $source['Source']['id']), null, __('Are you sure you want to delete # %s?', $source['Source']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Source'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Sources/index.ctp | PHP | gpl3 | 1,895 |
<div class="sources view">
<h2><?php echo __('Source');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($source['Source']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($source['Source']['name']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Source'), array('action' => 'edit', $source['Source']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Source'), array('action' => 'delete', $source['Source']['id']), null, __('Are you sure you want to delete # %s?', $source['Source']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Sources'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Source'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Languages');?></h3>
<?php if (!empty($source['Language'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Source Id'); ?></th>
<th><?php echo __('Destination Id'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($source['Language'] as $language): ?>
<tr>
<td><?php echo $language['id'];?></td>
<td><?php echo $language['source_id'];?></td>
<td><?php echo $language['destination_id'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'languages', 'action' => 'view', $language['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'languages', 'action' => 'edit', $language['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'languages', 'action' => 'delete', $language['id']), null, __('Are you sure you want to delete # %s?', $language['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Sources/view.ctp | PHP | gpl3 | 2,453 |
<div class="sources form">
<?php echo $this->Form->create('Source');?>
<fieldset>
<legend><?php echo __('Edit Source'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Source.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Source.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Sources'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Sources/edit.ctp | PHP | gpl3 | 925 |
<?php
/**
* Application level View Helper
*
* This file is application-wide helper file. You can put all
* application-wide helper-related methods here.
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Helper
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Helper', 'View');
/**
* This is a placeholder class.
* Create the same file in app/View/Helper/AppHelper.php
*
* Add your application-wide methods in the class below, your helpers
* will inherit them.
*
* @package app.View.Helper
*/
class AppHelper extends Helper {
}
| 0001-bee | trunk/cakephp2/app/View/Helper/AppHelper.php | PHP | gpl3 | 1,037 |
<div class="destinations form">
<?php echo $this->Form->create('Destination');?>
<fieldset>
<legend><?php echo __('Add Destination'); ?></legend>
<?php
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Destinations'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Destinations/add.ctp | PHP | gpl3 | 701 |
<div class="destinations index">
<h2><?php echo __('Destinations');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($destinations as $destination): ?>
<tr>
<td><?php echo h($destination['Destination']['id']); ?> </td>
<td><?php echo h($destination['Destination']['name']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $destination['Destination']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $destination['Destination']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $destination['Destination']['id']), null, __('Are you sure you want to delete # %s?', $destination['Destination']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Destination'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Destinations/index.ctp | PHP | gpl3 | 1,980 |
<div class="destinations view">
<h2><?php echo __('Destination');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($destination['Destination']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($destination['Destination']['name']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Destination'), array('action' => 'edit', $destination['Destination']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Destination'), array('action' => 'delete', $destination['Destination']['id']), null, __('Are you sure you want to delete # %s?', $destination['Destination']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Destinations'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Destination'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Languages');?></h3>
<?php if (!empty($destination['Language'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Source Id'); ?></th>
<th><?php echo __('Destination Id'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($destination['Language'] as $language): ?>
<tr>
<td><?php echo $language['id'];?></td>
<td><?php echo $language['source_id'];?></td>
<td><?php echo $language['destination_id'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'languages', 'action' => 'view', $language['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'languages', 'action' => 'edit', $language['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'languages', 'action' => 'delete', $language['id']), null, __('Are you sure you want to delete # %s?', $language['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Destinations/view.ctp | PHP | gpl3 | 2,543 |
<div class="destinations form">
<?php echo $this->Form->create('Destination');?>
<fieldset>
<legend><?php echo __('Edit Destination'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Destination.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Destination.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Destinations'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Destinations/edit.ctp | PHP | gpl3 | 955 |
<div class="bids form">
<?php echo $this->Form->create('Bid');?>
<fieldset>
<legend><?php echo __('Add Bid'); ?></legend>
<?php
echo $this->Form->input('job_id');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Bids'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Jobs'), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Job'), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Bids/add.ctp | PHP | gpl3 | 920 |
<div class="bids index">
<h2><?php echo __('Bids');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('job_id');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($bids as $bid): ?>
<tr>
<td><?php echo h($bid['Bid']['id']); ?> </td>
<td>
<?php echo $this->Html->link($bid['Job']['name'], array('controller' => 'jobs', 'action' => 'view', $bid['Job']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($bid['User']['name'], array('controller' => 'users', 'action' => 'view', $bid['User']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $bid['Bid']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $bid['Bid']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $bid['Bid']['id']), null, __('Are you sure you want to delete # %s?', $bid['Bid']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Bid'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Jobs'), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Job'), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Bids/index.ctp | PHP | gpl3 | 2,354 |
<div class="bids view">
<h2><?php echo __('Bid');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($bid['Bid']['id']); ?>
</dd>
<dt><?php echo __('Job'); ?></dt>
<dd>
<?php echo $this->Html->link($bid['Job']['name'], array('controller' => 'jobs', 'action' => 'view', $bid['Job']['id'])); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($bid['User']['name'], array('controller' => 'users', 'action' => 'view', $bid['User']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Bid'), array('action' => 'edit', $bid['Bid']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Bid'), array('action' => 'delete', $bid['Bid']['id']), null, __('Are you sure you want to delete # %s?', $bid['Bid']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Bids'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Bid'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Jobs'), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Job'), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Bids/view.ctp | PHP | gpl3 | 1,591 |
<div class="bids form">
<?php echo $this->Form->create('Bid');?>
<fieldset>
<legend><?php echo __('Edit Bid'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('job_id');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Bid.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Bid.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Bids'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Jobs'), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Job'), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Bids/edit.ctp | PHP | gpl3 | 1,158 |
<div class="translators form">
<?php echo $this->Form->create('Translator');?>
<fieldset>
<legend><?php echo __('Add Translator'); ?></legend>
<?php
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Translators'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Translator Friends'), array('controller' => 'translator_friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translator Friend'), array('controller' => 'translator_friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Translators/add.ctp | PHP | gpl3 | 733 |
<div class="translators index">
<h2><?php echo __('Translators');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($translators as $translator): ?>
<tr>
<td><?php echo h($translator['Translator']['id']); ?> </td>
<td><?php echo h($translator['Translator']['name']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $translator['Translator']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $translator['Translator']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $translator['Translator']['id']), null, __('Are you sure you want to delete # %s?', $translator['Translator']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Translator'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Translator Friends'), array('controller' => 'translator_friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translator Friend'), array('controller' => 'translator_friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Translators/index.ctp | PHP | gpl3 | 1,999 |
<div class="translators view">
<h2><?php echo __('Translator');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($translator['Translator']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($translator['Translator']['name']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Translator'), array('action' => 'edit', $translator['Translator']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Translator'), array('action' => 'delete', $translator['Translator']['id']), null, __('Are you sure you want to delete # %s?', $translator['Translator']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Translators'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translator'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translator Friends'), array('controller' => 'translator_friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translator Friend'), array('controller' => 'translator_friends', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Translator Friends');?></h3>
<?php if (!empty($translator['TranslatorFriend'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Translator Id'); ?></th>
<th><?php echo __('Friend Id'); ?></th>
<th><?php echo __('Approved'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($translator['TranslatorFriend'] as $translatorFriend): ?>
<tr>
<td><?php echo $translatorFriend['id'];?></td>
<td><?php echo $translatorFriend['translator_id'];?></td>
<td><?php echo $translatorFriend['friend_id'];?></td>
<td><?php echo $translatorFriend['approved'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'translator_friends', 'action' => 'view', $translatorFriend['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'translator_friends', 'action' => 'edit', $translatorFriend['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'translator_friends', 'action' => 'delete', $translatorFriend['id']), null, __('Are you sure you want to delete # %s?', $translatorFriend['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Translator Friend'), array('controller' => 'translator_friends', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/Translators/view.ctp | PHP | gpl3 | 2,792 |
<div class="translators form">
<?php echo $this->Form->create('Translator');?>
<fieldset>
<legend><?php echo __('Edit Translator'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Translator.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Translator.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Translators'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Translator Friends'), array('controller' => 'translator_friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translator Friend'), array('controller' => 'translator_friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/Translators/edit.ctp | PHP | gpl3 | 985 |
<div class="messagesUsers form">
<?php echo $this->Form->create('MessagesUser');?>
<fieldset>
<legend><?php echo __('Add Messages User'); ?></legend>
<?php
echo $this->Form->input('message_id');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Messages Users'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Messages'), array('controller' => 'messages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Message'), array('controller' => 'messages', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/MessagesUsers/add.ctp | PHP | gpl3 | 978 |
<div class="messagesUsers index">
<h2><?php echo __('Messages Users');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('message_id');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($messagesUsers as $messagesUser): ?>
<tr>
<td><?php echo h($messagesUser['MessagesUser']['id']); ?> </td>
<td>
<?php echo $this->Html->link($messagesUser['Message']['id'], array('controller' => 'messages', 'action' => 'view', $messagesUser['Message']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($messagesUser['User']['name'], array('controller' => 'users', 'action' => 'view', $messagesUser['User']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $messagesUser['MessagesUser']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $messagesUser['MessagesUser']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $messagesUser['MessagesUser']['id']), null, __('Are you sure you want to delete # %s?', $messagesUser['MessagesUser']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Messages User'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Messages'), array('controller' => 'messages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Message'), array('controller' => 'messages', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/MessagesUsers/index.ctp | PHP | gpl3 | 2,557 |
<div class="messagesUsers view">
<h2><?php echo __('Messages User');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($messagesUser['MessagesUser']['id']); ?>
</dd>
<dt><?php echo __('Message'); ?></dt>
<dd>
<?php echo $this->Html->link($messagesUser['Message']['id'], array('controller' => 'messages', 'action' => 'view', $messagesUser['Message']['id'])); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($messagesUser['User']['name'], array('controller' => 'users', 'action' => 'view', $messagesUser['User']['id'])); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Messages User'), array('action' => 'edit', $messagesUser['MessagesUser']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Messages User'), array('action' => 'delete', $messagesUser['MessagesUser']['id']), null, __('Are you sure you want to delete # %s?', $messagesUser['MessagesUser']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Messages Users'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Messages User'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Messages'), array('controller' => 'messages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Message'), array('controller' => 'messages', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/MessagesUsers/view.ctp | PHP | gpl3 | 1,788 |
<div class="messagesUsers form">
<?php echo $this->Form->create('MessagesUser');?>
<fieldset>
<legend><?php echo __('Edit Messages User'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('message_id');
echo $this->Form->input('user_id');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('MessagesUser.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('MessagesUser.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Messages Users'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Messages'), array('controller' => 'messages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Message'), array('controller' => 'messages', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/MessagesUsers/edit.ctp | PHP | gpl3 | 1,234 |
<div class="usersFriends form">
<?php echo $this->Form->create('UsersFriend');?>
<fieldset>
<legend><?php echo __('Add Users Friend'); ?></legend>
<?php
echo $this->Form->input('user_id');
echo $this->Form->input('friend_id');
echo $this->Form->input('status');
echo $this->Form->input('text');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Users Friends'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Friends'), array('controller' => 'friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Friend'), array('controller' => 'friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/UsersFriends/add.ctp | PHP | gpl3 | 1,043 |
<div class="usersFriends index">
<h2><?php echo __('Users Friends');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('user_id');?></th>
<th><?php echo $this->Paginator->sort('friend_id');?></th>
<th><?php echo $this->Paginator->sort('status');?></th>
<th><?php echo $this->Paginator->sort('text');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($usersFriends as $usersFriend): ?>
<tr>
<td><?php echo h($usersFriend['UsersFriend']['id']); ?> </td>
<td>
<?php echo $this->Html->link($usersFriend['User']['name'], array('controller' => 'users', 'action' => 'view', $usersFriend['User']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($usersFriend['Friend'][''], array('controller' => 'friends', 'action' => 'view', $usersFriend['Friend']['id'])); ?>
</td>
<td><?php echo h($usersFriend['UsersFriend']['status']); ?> </td>
<td><?php echo h($usersFriend['UsersFriend']['text']); ?> </td>
<td><?php echo h($usersFriend['UsersFriend']['created']); ?> </td>
<td><?php echo h($usersFriend['UsersFriend']['modified']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $usersFriend['UsersFriend']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $usersFriend['UsersFriend']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $usersFriend['UsersFriend']['id']), null, __('Are you sure you want to delete # %s?', $usersFriend['UsersFriend']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Users Friend'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Friends'), array('controller' => 'friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Friend'), array('controller' => 'friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/UsersFriends/index.ctp | PHP | gpl3 | 3,066 |
<div class="usersFriends view">
<h2><?php echo __('Users Friend');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($usersFriend['UsersFriend']['id']); ?>
</dd>
<dt><?php echo __('User'); ?></dt>
<dd>
<?php echo $this->Html->link($usersFriend['User']['name'], array('controller' => 'users', 'action' => 'view', $usersFriend['User']['id'])); ?>
</dd>
<dt><?php echo __('Friend'); ?></dt>
<dd>
<?php echo $this->Html->link($usersFriend['Friend'][''], array('controller' => 'friends', 'action' => 'view', $usersFriend['Friend']['id'])); ?>
</dd>
<dt><?php echo __('Status'); ?></dt>
<dd>
<?php echo h($usersFriend['UsersFriend']['status']); ?>
</dd>
<dt><?php echo __('Text'); ?></dt>
<dd>
<?php echo h($usersFriend['UsersFriend']['text']); ?>
</dd>
<dt><?php echo __('Created'); ?></dt>
<dd>
<?php echo h($usersFriend['UsersFriend']['created']); ?>
</dd>
<dt><?php echo __('Modified'); ?></dt>
<dd>
<?php echo h($usersFriend['UsersFriend']['modified']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Users Friend'), array('action' => 'edit', $usersFriend['UsersFriend']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Users Friend'), array('action' => 'delete', $usersFriend['UsersFriend']['id']), null, __('Are you sure you want to delete # %s?', $usersFriend['UsersFriend']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Users Friends'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Users Friend'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Friends'), array('controller' => 'friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Friend'), array('controller' => 'friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/UsersFriends/view.ctp | PHP | gpl3 | 2,274 |
<div class="usersFriends form">
<?php echo $this->Form->create('UsersFriend');?>
<fieldset>
<legend><?php echo __('Edit Users Friend'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('user_id');
echo $this->Form->input('friend_id');
echo $this->Form->input('status');
echo $this->Form->input('text');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('UsersFriend.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('UsersFriend.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Users Friends'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Friends'), array('controller' => 'friends', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Friend'), array('controller' => 'friends', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/UsersFriends/edit.ctp | PHP | gpl3 | 1,297 |
<div class="eduTypes form">
<?php echo $this->Form->create('EduType');?>
<fieldset>
<legend><?php echo __('Add Edu Type'); ?></legend>
<?php
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Edu Types'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Educations'), array('controller' => 'educations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Education'), array('controller' => 'educations', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/EduTypes/add.ctp | PHP | gpl3 | 691 |
<div class="eduTypes index">
<h2><?php echo __('Edu Types');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($eduTypes as $eduType): ?>
<tr>
<td><?php echo h($eduType['EduType']['id']); ?> </td>
<td><?php echo h($eduType['EduType']['name']); ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $eduType['EduType']['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $eduType['EduType']['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $eduType['EduType']['id']), null, __('Are you sure you want to delete # %s?', $eduType['EduType']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</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 Edu Type'), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Educations'), array('controller' => 'educations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Education'), array('controller' => 'educations', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/EduTypes/index.ctp | PHP | gpl3 | 1,918 |
<div class="eduTypes view">
<h2><?php echo __('Edu Type');?></h2>
<dl>
<dt><?php echo __('Id'); ?></dt>
<dd>
<?php echo h($eduType['EduType']['id']); ?>
</dd>
<dt><?php echo __('Name'); ?></dt>
<dd>
<?php echo h($eduType['EduType']['name']); ?>
</dd>
</dl>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Edu Type'), array('action' => 'edit', $eduType['EduType']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Edu Type'), array('action' => 'delete', $eduType['EduType']['id']), null, __('Are you sure you want to delete # %s?', $eduType['EduType']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Edu Type'), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Educations'), array('controller' => 'educations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Education'), array('controller' => 'educations', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php echo __('Related Educations');?></h3>
<?php if (!empty($eduType['Education'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Name'); ?></th>
<th><?php echo __('Start'); ?></th>
<th><?php echo __('End'); ?></th>
<th><?php echo __('User Id'); ?></th>
<th><?php echo __('Edu Type Id'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($eduType['Education'] as $education): ?>
<tr>
<td><?php echo $education['id'];?></td>
<td><?php echo $education['name'];?></td>
<td><?php echo $education['start'];?></td>
<td><?php echo $education['end'];?></td>
<td><?php echo $education['user_id'];?></td>
<td><?php echo $education['edu_type_id'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'educations', 'action' => 'view', $education['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'educations', 'action' => 'edit', $education['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'educations', 'action' => 'delete', $education['id']), null, __('Are you sure you want to delete # %s?', $education['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Education'), array('controller' => 'educations', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
| 0001-bee | trunk/cakephp2/app/View/EduTypes/view.ctp | PHP | gpl3 | 2,738 |
<div class="eduTypes form">
<?php echo $this->Form->create('EduType');?>
<fieldset>
<legend><?php echo __('Edit Edu Type'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('EduType.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('EduType.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Edu Types'), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Educations'), array('controller' => 'educations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Education'), array('controller' => 'educations', 'action' => 'add')); ?> </li>
</ul>
</div>
| 0001-bee | trunk/cakephp2/app/View/EduTypes/edit.ctp | PHP | gpl3 | 937 |
<?php
/**
* Uploader Plugin Config
*
* A config class that holds all the settings and default mimetypes.
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
/**
* Current version.
*/
$config['Uploader']['version'] = '2.7';
/**
* The accepted file/mime types.
*/
$config['Uploader']['mimeTypes'] = array(
'image' => array(
'bmp' => 'image/bmp',
'gif' => 'image/gif',
'jpe' => 'image/jpeg',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'pjpeg' => 'image/pjpeg',
'svg' => 'image/svg+xml',
'svgz' => 'image/svg+xml',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'ico' => 'image/vnd.microsoft.icon',
'png' => array('image/png', 'image/x-png'),
'xpng' => 'image/x-png'
),
'text' => array(
'txt' => 'text/plain',
'asc' => 'text/plain',
'css' => 'text/css',
'csv' => 'text/csv',
'htm' => 'text/html',
'html' => 'text/html',
'stm' => 'text/html',
'rtf' => 'text/rtf',
'rtx' => 'text/richtext',
'sgm' => 'text/sgml',
'sgml' => 'text/sgml',
'tsv' => 'text/tab-separated-values',
'tpl' => 'text/template',
'xml' => 'text/xml',
'js' => 'text/javascript',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'json' => 'application/json'
),
'archive' => array(
'gz' => 'application/x-gzip',
'gtar' => 'application/x-gtar',
'z' => 'application/x-compress',
'tgz' => 'application/x-compressed',
'zip' => 'application/zip',
'rar' => 'application/x-rar-compressed',
'rev' => 'application/x-rar-compressed',
'tar' => 'application/x-tar',
'7z' => 'application/x-7z-compressed'
),
'audio' => array(
'aif' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'au' => 'audio/basic',
'kar' => 'audio/midi',
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mp2' => 'audio/mpeg',
'mp3' => 'audio/mpeg',
'mpga' => 'audio/mpeg',
'ra' => 'audio/x-realaudio',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'snd' => 'audio/basic',
'tsi' => 'audio/TSP-audio',
'wav' => 'audio/x-wav',
'wma' => 'audio/x-ms-wma'
),
'video' => array(
'flv' => 'video/x-flv',
'fli' => 'video/x-fli',
'avi' => 'video/x-msvideo',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'movie' => 'video/x-sgi-movie',
'mp2' => 'video/mpeg',
'mpa' => 'video/mpeg',
'mpv2' => 'video/mpeg',
'mpe' => 'video/mpeg',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mp4' => 'video/mp4',
'viv' => 'video/vnd.vivo',
'vivo' => 'video/vnd.vivo',
'wmv' => 'video/x-ms-wmv'
),
'application' => array(
'js' => 'application/x-javascript',
'xlc' => 'application/vnd.ms-excel',
'xll' => 'application/vnd.ms-excel',
'xlm' => 'application/vnd.ms-excel',
'xls' => 'application/vnd.ms-excel',
'xlw' => 'application/vnd.ms-excel',
'doc' => 'application/msword',
'dot' => 'application/msword',
'pdf' => 'application/pdf',
'psd' => 'image/vnd.adobe.photoshop',
'ai' => 'application/postscript',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'swf' => 'application/x-shockwave-flash'
)
);
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/config/config.php | PHP | gpl3 | 3,391 |
<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'upload', 'action' => $this->action)));
echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->input('file2', array('type' => 'file'));
echo $this->Form->end('Upload'); | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/views/index.ctp | PHP | gpl3 | 286 |
<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'upload', 'action' => $this->action)));
echo $this->Form->end('Import'); | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/views/import.ctp | PHP | gpl3 | 169 |
<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'upload', 'action' => $this->action)));
echo $this->Form->input('caption');
echo $this->Form->input('path', array('type' => 'file'));
echo $this->Form->end('Upload'); | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/views/behaviors.ctp | PHP | gpl3 | 263 |
<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'upload', 'action' => $this->action)));
echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->input('Upload1.file', array('type' => 'file'));
echo $this->Form->input('Upload2.file', array('type' => 'file'));
echo $this->Form->end('Upload'); | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/views/multi_models.ctp | PHP | gpl3 | 359 |
<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'upload', 'action' => $this->action)));
echo $this->Form->input('file1', array('type' => 'file'));
echo $this->Form->input('file2', array('type' => 'file'));
echo $this->Form->input('file3', array('type' => 'file'));
echo $this->Form->end('Upload'); | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/views/upload_all.ctp | PHP | gpl3 | 346 |
<?php
/**
* Uploader Testing Model
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
/**
CREATE TABLE IF NOT EXISTS `uploads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`caption` varchar(255) NOT NULL,
`path` varchar(255) NOT NULL,
`path_alt` varchar(255) NOT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
*/
class Upload extends AppModel {
/**
* Validation for default forms. Testing to make sure it combines with FileValidation.
*
* @access public
* @var array
*/
public $validate = array('caption' => 'notEmpty');
/**
* Behavior settings for both FileValidation and Attachment.
*
* @access public
* @var array
*/
public $actsAs = array(
'Uploader.FileValidation' => array(
'file' => array(
'extension' => array(
'value' => array('gif', 'jpg', 'jpeg'),
'error' => 'Only gif, jpg and jpeg images are allowed!'
),
'minWidth' => 500,
'minHeight' => 500,
'required' => true
)
),
'Uploader.Attachment' => array(
'file' => array(
'name' => 'formatFileName',
'uploadDir' => '/files/uploads/',
'dbColumn' => 'path',
'maxNameLength' => 30,
'overwrite' => true,
'transforms' => array(
// Save additional images in the databases after transforming
array(
'method' => 'resize',
'width' => 100,
'height' => 100,
'dbColumn' => 'path_alt'
)
),
'metaColumns' => array(
'size' => 'filesize', // The size value will be saved to the filesize column
'type' => 'type' // And the same for the mimetype
)
)
)
);
/**
* Format the filename a specific way before uploading and attaching.
*
* @access public
* @param string $name - The current filename without extension
* @param string $ext - The file extension
* @param string $field - The form field name
* @param array $file - The $_FILES data
* @return string
*/
public function formatFileName($name, $ext, $field, $file) {
return md5($name) .'.'. $ext;
}
} | 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/models/upload.php | PHP | gpl3 | 2,273 |
<?php
/**
* Uploader Testing Controller
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
class UploadController extends AppController {
/**
* Include plugin.
*/
public $uses = array('Upload');
public $components = array('Uploader.Uploader', 'Security');
/**
* Test case for uploading an image with no transformations.
*/
public function index() {
if (!empty($this->data)) {
if ($data = $this->Uploader->upload('file', array('name' => 'default', 'overwrite' => true))) {
debug($data);
}
}
$this->set('title_for_layout', 'Upload: Test Case');
}
/**
* Test case for getting a files meta data: dimensions, extension, mimetype, etc.
*/
public function meta() {
$this->testPath = $this->testPath .'test_dimensions.jpg';
debug($this->Uploader->dimensions($this->testPath));
debug($this->Uploader->mimeType($this->testPath));
debug($this->Uploader->ext($this->testPath));
$this->set('title_for_layout', 'Upload: Meta Data');
$this->render('index');
}
/**
* Test case for crop()ping images.
*/
public function crop() {
if (!empty($this->data)) {
if ($data = $this->Uploader->upload('file', array('name' => 'crop', 'overwrite' => true))) {
debug($data);
$crop = $this->Uploader->crop(array('width' => 100, 'height' => 100));
debug($crop);
}
}
$this->set('title_for_layout', 'Upload: Crop');
$this->render('index');
}
/**
* Test case for flip()ping images.
*/
public function flip() {
if (!empty($this->data)) {
if ($data = $this->Uploader->upload('file', array('name' => 'flip', 'overwrite' => true))) {
debug($data);
$flip = $this->Uploader->flip(array('dir' => UploaderComponent::DIR_BOTH));
debug($flip);
}
}
$this->set('title_for_layout', 'Upload: Flip');
$this->render('index');
}
/**
* Test case for resize()ing images.
*/
public function resize() {
if (!empty($this->data)) {
if ($data = $this->Uploader->upload('file', array('name' => 'resize', 'overwrite' => true))) {
debug($data);
$resize = $this->Uploader->resize(array('width' => 1000, 'expand' => false));
debug($resize);
}
}
$this->set('title_for_layout', 'Upload: Resize');
$this->render('index');
}
/**
* Test case for scale()ing images.
*/
public function scale() {
if (!empty($this->data)) {
if ($data = $this->Uploader->upload('file', array('name' => 'scale', 'overwrite' => true))) {
debug($data);
$scale = $this->Uploader->scale(array('percent' => .3));
debug($scale);
}
}
$this->set('title_for_layout', 'Upload: Scale');
$this->render('index');
}
/**
* Test case for uploading multiple images.
*/
public function upload_all() {
if (!empty($this->data)) {
if ($data = $this->Uploader->uploadAll(array('file1', 'file2', 'file3'), true)) {
debug($data);
}
}
$this->set('title_for_layout', 'Upload: Upload All');
}
/**
* Test case for uploading multiple images with validation.
*/
public function upload_all_validate() {
if (!empty($this->data)) {
$this->Upload->set($this->data);
if ($this->Upload->validates()) {
if ($data = $this->Uploader->uploadAll(array('file1', 'file2', 'file3'), true)) {
debug($data);
}
}
}
$this->set('title_for_layout', 'Upload: Upload All with Validation');
$this->render('upload_all');
}
/**
* Test case for uploading multiple images from different models.
*/
public function multi_models() {
if (!empty($this->data)) {
if ($data = $this->Uploader->uploadAll(array('Upload.file', 'Upload1.file', 'Upload2.file'), true)) {
debug($data);
}
}
$this->set('title_for_layout', 'Upload: Multiple Models');
}
/**
* Test case for checking the behavior validation.
*/
public function behaviors() {
if (!empty($this->data)) {
if ($this->Upload->save($this->data)) {
debug('Image uploaded and row saved!');
}
}
$this->set('title_for_layout', 'Upload: Behavior Validation and Attachment Testing');
}
/**
* Test case for importing a file from a local source.
*/
public function import() {
$this->testPath = $this->testPath .'test_import.jpg';
if (!empty($this->data)) {
if ($data = $this->Uploader->import($this->testPath, array('name' => 'imported', 'overwrite' => true))) {
debug($data);
$scale = $this->Uploader->scale(array('percent' => .3));
debug($scale);
$crop = $this->Uploader->crop(array('width' => 100, 'height' => 100));
debug($crop);
}
}
$this->set('title_for_layout', 'Upload: Import Local File');
$this->render('import');
}
/**
* Test case for importing a file from a remote source.
*/
public function import_remote() {
if (!empty($this->data)) {
if ($data = $this->Uploader->importRemote('http://www.google.com/images/logos/ps_logo2.png', array('name' => 'remote', 'overwrite' => false))) {
debug($data);
$crop = $this->Uploader->crop(array('width' => 100, 'height' => 100));
debug($crop);
$flip = $this->Uploader->flip(array('dir' => UploaderComponent::DIR_BOTH));
debug($flip);
}
}
$this->set('title_for_layout', 'Upload: Import Remote File');
$this->render('import');
}
/**
* Set the test path.
*/
public function beforeFilter() {
$this->testPath = $this->Uploader->baseDir . $this->Uploader->uploadDir;
}
}
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/tests/controllers/upload_controller.php | PHP | gpl3 | 5,539 |
<?php
/**
* File Validation Behavior
*
* A CakePHP Behavior that adds validation model rules to file uploading.
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
App::import('Component', 'Uploader.Uploader');
Configure::load('Uploader.config');
class FileValidationBehavior extends ModelBehavior {
/**
* Current settings.
*
* @access protected
* @var array
*/
protected $_settings = array();
/**
* Default list of validation sets.
*
* @access protected
* @var array
*/
protected $_validations = array(
'minWidth' => array(
'rule' => array('minWidth'),
'message' => 'Your image width is too small'
),
'minHeight' => array(
'rule' => array('minHeight'),
'message' => 'Your image height is too small'
),
'maxWidth' => array(
'rule' => array('maxWidth'),
'message' => 'Your image width is too large'
),
'maxHeight' => array(
'rule' => array('maxHeight'),
'message' => 'Your image height is too large'
),
'filesize' => array(
'rule' => array('filesize'),
'message' => 'Your filesize is too large'
),
'extension' => array(
'rule' => array('extension'),
'message' => 'Your file type is not allowed'
),
'required' => array(
'rule' => array('required'),
'message' => 'This file is required'
)
);
/**
* Setup the validation and model settings.
*
* @access public
* @param object $Model
* @param array $settings
* @return void
*/
public function setup($Model, array $settings = array()) {
$this->Uploader = new UploaderComponent();
$this->Uploader->initialize($Model);
if (!empty($settings) && is_array($settings)) {
foreach ($settings as $field => $options) {
$this->_settings[$Model->alias][$field] = $options + array('required' => true);
}
}
}
/**
* Validates an image filesize. Default max size is 5 MB.
*
* @access public
* @param object $Model
* @param array $data
* @param int $size
* @return boolean
*/
public function filesize($Model, $data, $size = 5242880) {
if (empty($size) || !is_numeric($size)) {
$size = 5242880;
}
foreach ($data as $fieldName => $field) {
if (!$this->_settings[$Model->alias][$fieldName]['required'] && empty($field['tmp_name'])) {
return true;
} else if (empty($field['tmp_name'])) {
return false;
}
return ($field['size'] <= $size);
}
return true;
}
/**
* Checks the maximum image height.
*
* @access public
* @param object $Model
* @param array $data
* @param int $size
* @return boolean
*/
public function maxHeight($Model, $data, $size = 100) {
return $this->_validateImage($Model, $data, 'maxHeight', $size);
}
/**
* Checks the maximum image width.
*
* @access public
* @param object $Model
* @param array $data
* @param int $size
* @return boolean
*/
public function maxWidth($Model, $data, $size = 100) {
return $this->_validateImage($Model, $data, 'maxWidth', $size);
}
/**
* Checks the minimum image height.
*
* @access public
* @param object $Model
* @param array $data
* @param int $size
* @return boolean
*/
public function minHeight($Model, $data, $size = 100) {
return $this->_validateImage($Model, $data, 'minHeight', $size);
}
/**
* Checks the minimum image width.
*
* @access public
* @param object $Model
* @param array $data
* @param int $size
* @return boolean
*/
public function minWidth($Model, $data, $size = 100) {
return $this->_validateImage($Model, $data, 'minWidth', $size);
}
/**
* Validates the ext and mimetype.
*
* @access public
* @param object $Model
* @param array $data
* @param array $allowed
* @return boolean
*/
public function extension($Model, $data, array $allowed = array()) {
foreach ($data as $fieldName => $field) {
if (!$this->_settings[$Model->alias][$fieldName]['required'] && empty($field['tmp_name'])) {
return true;
} else if (empty($field['tmp_name'])) {
return false;
} else {
$ext = $this->Uploader->ext($field['name']);
}
if (!$this->Uploader->checkMimeType($ext, $field['type']) || (!empty($allowed) && !in_array($ext, $allowed))) {
return false;
}
}
return true;
}
/**
* Makes sure a file field is required and not optional.
*
* @access public
* @param object $Model
* @param array $data
* @return boolean
*/
public function required($Model, $data) {
foreach ($data as $fieldName => $field) {
$required = $this->_settings[$Model->alias][$fieldName]['required'];
if (is_array($required)) {
$required = $required['value'];
}
if ($required && empty($field['tmp_name'])) {
return false;
}
}
return true;
}
/**
* Build the validation rules and validate.
*
* @access public
* @param object $Model
* @return boolean
*/
public function beforeValidate($Model) {
if (!empty($this->_settings[$Model->alias])) {
foreach ($this->_settings[$Model->alias] as $field => $rules) {
$validations = array();
foreach ($rules as $rule => $setting) {
$set = $this->_validations[$rule];
if (is_array($setting) && !isset($setting[0])) {
if (!empty($setting['error'])) {
$set['message'] = $setting['error'];
}
switch ($rule) {
case 'required':
$set['rule'] = array($rule);
break;
case 'extension':
$set['rule'] = array($rule, (array)$setting['value']);
break;
default:
$set['rule'] = array($rule, (int)$setting['value']);
break;
}
} else {
$set['rule'] = array($rule, $setting);
}
if (isset($rules['required'])) {
if (is_array($rules['required'])) {
$set['allowEmpty'] = !(bool)$rules['required']['value'];
} else {
$set['allowEmpty'] = !(bool)$rules['required'];
}
}
$validations[$rule] = $set;
}
if (!empty($validations)) {
if (!empty($Model->validate[$field])) {
$validations = $validations + $Model->validate[$field];
}
$Model->validate[$field] = $validations;
}
}
}
return true;
}
/**
* Validates multiple combinations of height and width for an image.
*
* @access protected
* @param object $Model
* @param array $data
* @param string $type
* @param int $size
* @return boolean
*/
protected function _validateImage($Model, $data, $type, $size = 100) {
foreach ($data as $fieldName => $field) {
if (!$this->_settings[$Model->alias][$fieldName]['required'] && empty($field['tmp_name'])) {
return true;
} else if (empty($field['tmp_name'])) {
return false;
}
$file = getimagesize($field['tmp_name']);
if (!$file) {
return false;
}
$width = $file[0];
$height = $file[1];
switch ($type) {
case 'maxWidth': return ($width <= $size); break;
case 'maxHeight': return ($height <= $size); break;
case 'minWidth': return ($width >= $size); break;
case 'minHeight': return ($height >= $size); break;
}
}
return true;
}
}
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/models/behaviors/file_validation.php | PHP | gpl3 | 7,229 |
<?php
/**
* Attachment Behavior
*
* A CakePHP Behavior that attaches a file to a model, and uploads automatically, then stores a value in the database.
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
App::import('Component', array('Uploader.Uploader', 'Uploader.S3Transfer'));
class AttachmentBehavior extends ModelBehavior {
/**
* AS3 domain snippet.
*/
const AS3_DOMAIN = 's3.amazonaws.com';
/**
* Files that have been uploaded or attached; used for rollback functions.
*
* @access protected
* @var array
*/
protected $_attached = array();
/**
* All user defined attachments; images => model.
*
* @access protected
* @var array
*/
protected $_attachments = array();
/**
* The default settings for attachments.
*
* @access protected
* @var array
*/
protected $_defaults = array(
'name' => '',
'baseDir' => '',
'uploadDir' => '',
'dbColumn' => 'uploadPath',
'importFrom' => '',
'defaultPath' => '',
'maxNameLength' => null,
'overwrite' => true,
'stopSave' => true,
'transforms' => array(),
's3' => array(),
'metaColumns' => array(
'ext' => '',
'type' => '',
'size' => '',
'group' => '',
'width' => '',
'height' => '',
'filesize' => ''
)
);
/**
* Initialize uploader and save attachments.
*
* @access public
* @uses UploaderComponent, S3TransferComponent
* @param object $Model
* @param array $settings
* @return boolean
*/
public function setup($Model, array $settings = array()) {
$this->Uploader = new UploaderComponent();
$this->S3Transfer = new S3TransferComponent();
if (!empty($settings) && is_array($settings)) {
foreach ($settings as $field => $attachment) {
if (isset($attachment['skipSave'])) {
$attachment['stopSave'] = $attachment['skipSave'];
}
$this->_attachments[$Model->alias][$field] = $attachment + $this->_defaults;
}
}
}
/**
* Deletes any files that have been attached to this model.
*
* @access public
* @param object $Model
* @return boolean
*/
public function beforeDelete($Model) {
if (empty($Model->id)) {
return false;
}
$data = $Model->read(null, $Model->id);
if (!empty($data[$Model->alias])) {
foreach ($data[$Model->alias] as $field => $value) {
if (strpos($value, self::AS3_DOMAIN) !== false) {
$this->S3Transfer->delete($value);
} else {
if (!$this->Uploader->delete($value)) {
@unlink($value);
}
}
}
}
return true;
}
/**
* Before saving the data, try uploading the image, if successful save to database.
*
* @access public
* @param object $Model
* @return boolean
*/
public function beforeSave($Model) {
if (empty($Model->data[$Model->alias])) {
return true;
}
$this->Uploader->initialize($Model);
$this->Uploader->startup($Model);
foreach ($Model->data[$Model->alias] as $field => $file) {
if (empty($this->_attachments[$Model->alias][$field])) {
continue;
}
$attachment = $this->_attachments[$Model->alias][$field];
$options = array();
$s3 = false;
// Let the save work even if the image is empty.
// If the image should be required, use the FileValidation behavior.
if ($this->isEmpty($file, $attachment)) {
$Model->data[$Model->alias][$attachment['dbColumn']] = $attachment['defaultPath'];
continue;
}
// Should we continue if a file error'd during upload?
if (isset($file['error']) && $file['error'] == UPLOAD_ERR_NO_FILE) {
if ($attachment['stopSave']) {
return false;
} else {
continue;
}
}
// Amazon S3
if (!empty($attachment['s3'])) {
if (!empty($attachment['s3']['bucket']) && !empty($attachment['s3']['accessKey']) && !empty($attachment['s3']['secretKey'])) {
$this->S3Transfer->bucket = $attachment['s3']['bucket'];
$this->S3Transfer->accessKey = $attachment['s3']['accessKey'];
$this->S3Transfer->secretKey = $attachment['s3']['secretKey'];
if (isset($attachment['s3']['useSsl'])) {
$this->S3Transfer->useSsl = (bool)$attachment['s3']['useSsl'];
}
$this->S3Transfer->startup($Model);
$s3 = true;
} else {
trigger_error('Uploader.Attachment::beforeSave(): To use the S3 transfer, you must supply an accessKey, secretKey and bucket.', E_USER_WARNING);
}
}
// Uploader
if (!empty($attachment['baseDir'])) {
$this->Uploader->baseDir = $attachment['baseDir'];
}
if (!empty($attachment['uploadDir'])) {
$this->Uploader->uploadDir = $attachment['uploadDir'];
}
if (is_numeric($attachment['maxNameLength'])) {
$this->Uploader->maxNameLength = $attachment['maxNameLength'];
}
if (is_bool($attachment['overwrite'])) {
$options['overwrite'] = $attachment['overwrite'];
}
if (!empty($attachment['name']) && method_exists($Model, $attachment['name'])) {
$options['name'] = $Model->{$attachment['name']}(
substr($file['name'], 0, strpos($file['name'], '.')),
$this->Uploader->ext($file['name']),
$field,
$file
);
}
if (is_string($file)) {
$attachment['importFrom'] = $file;
}
// Upload or import the file and attach to model data
if ($upload = $this->upload($field, $attachment, $options)) {
$basePath = ($s3) ? $this->S3Transfer->transfer($upload['path']) : $upload['path'];
$Model->data[$Model->alias][$attachment['dbColumn']] = $basePath;
$this->_attached[$field][$attachment['dbColumn']] = $basePath;
// Apply transformations
if (!empty($attachment['transforms'])) {
foreach ($attachment['transforms'] as $method => $options) {
if (isset($options['method'])) {
$method = $options['method'];
unset($options['method']);
}
if (!method_exists($this->Uploader, $method)) {
trigger_error('Uploader.Attachment::beforeSave(): "'. $method .'" is not a defined transformation method.', E_USER_WARNING);
return false;
}
if ($path = $this->Uploader->{$method}($options)) {
if ($s3) {
$path = $this->S3Transfer->transfer($path);
}
$Model->data[$Model->alias][$options['dbColumn']] = $path;
$this->_attached[$field][$options['dbColumn']] = $path;
// Delete original if same column name and are not the same file
// Which can happen if 'append' => '' is defined in the options
if ($options['dbColumn'] == $attachment['dbColumn'] && $basePath != $Model->data[$Model->alias][$attachment['dbColumn']]) {
if ($s3) {
$this->S3Transfer->delete($basePath);
} else {
$this->Uploader->delete($basePath);
}
}
} else {
$this->deleteAttached($field);
$Model->validationErrors[$field] = sprintf(__('An error occured during "%s" transformation!', true), $method);
return false;
}
}
}
if (!empty($attachment['metaColumns'])) {
foreach ($attachment['metaColumns'] as $field => $dbCol) {
if (isset($upload[$field])) {
$Model->data[$Model->alias][$dbCol] = $upload[$field];
}
}
}
} else {
$Model->validationErrors[$field] = __('There was an error attaching this file!', true);
return false;
}
}
return true;
}
/**
* Delete all attached images if attaching fails midway.
*
* @access public
* @param string $file
* @return void
*/
public function deleteAttached($file) {
if (!empty($this->_attached[$file])) {
foreach ($this->_attached[$file] as $column => $path) {
if (strpos($path, self::AS3_DOMAIN) !== false) {
$this->S3Transfer->delete($path);
} else {
$this->Uploader->delete($path);
}
}
}
}
/**
* Check if the file is an empty upload or import.
*
* @access public
* @param array|string $data
* @param array $attachment
* @return boolean
*/
public function isEmpty($data, $attachment) {
return ((is_array($data) && empty($data['tmp_name'])) || (empty($attachment['importFrom']) && empty($data)));
}
/**
* Applies dynamic settings to an attachment.
*
* @access public
* @param string $model
* @param string $file
* @param array $settings
* @return void
*/
public function update($model, $file, $settings) {
if (isset($this->_attachments[$model][$file])) {
$this->_attachments[$model][$file] = $settings + $this->_attachments[$model][$file];
}
}
/**
* Attempt to upload a file via remote import, file system import or standard upload.
*
* @access public
* @param string $field
* @param array $attachment
* @param array $options
* @return array
*/
public function upload($field, $attachment, $options) {
if (!empty($attachment['importFrom'])) {
if (preg_match('/(http|https)/', $attachment['importFrom'])) {
return $this->Uploader->importRemote($attachment['importFrom'], $options);
} else {
return $this->Uploader->import($attachment['importFrom'], $options);
}
}
return $this->Uploader->upload($field, $options);
}
}
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/models/behaviors/attachment.php | PHP | gpl3 | 9,188 |
<?php
/**
* Uploader Component
*
* A CakePHP Component that will upload a wide range of file types. Each file will be uploaded into app/webroot/<upload dir> (the path your provide).
* Security and type checking have been integrated to only allow valid files. Additionally, images have the option of transforming an image.
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
App::import('Core', array('Folder', 'HttpSocket'));
Configure::load('Uploader.config');
class UploaderComponent extends Object {
/**
* The direction to flip: vertical.
*
* @constant
* @var int
*/
const DIR_VERT = 1;
/**
* The direction to flip: horizontal.
*
* @constant
* @var int
*/
const DIR_HORI = 2;
/**
* The direction to flip: vertical and horizontal.
*
* @constant
* @var int
*/
const DIR_BOTH = 3;
/**
* The location to crop: top.
*
* @constant
* @var int
*/
const LOC_TOP = 1;
/**
* The location to crop: bottom.
*
* @constant
* @var int
*/
const LOC_BOT = 2;
/**
* The location to crop: left.
*
* @constant
* @var int
*/
const LOC_LEFT = 3;
/**
* The location to crop: right.
*
* @constant
* @var int
*/
const LOC_RIGHT = 4;
/**
* The location to crop: center.
*
* @constant
* @var int
*/
const LOC_CENTER = 5;
/**
* Should we allow file uploading for this request?
*
* @access public
* @var boolean
*/
public $enableUpload = true;
/**
* Max filesize using shorthand notation: http://php.net/manual/faq.using.php#faq.using.shorthandbytes
*
* @access public
* @var string
*/
public $maxFileSize = '5M';
/**
* How long should file names be?
*
* @access public
* @var int
*/
public $maxNameLength = 40;
/**
* Should we scan the file for viruses? Requires ClamAV module: http://clamav.net/
*
* @access public
* @var boolean
*/
public $scanFile = false;
/**
* Temp upload directory.
*
* @access public
* @var string
*/
public $tempDir = TMP;
/**
* Base upload directory; usually Cake webroot.
*
* @access public
* @var string
*/
public $baseDir = WWW_ROOT;
/**
* Destination upload directory within $baseDir.
*
* @access public
* @var string
*/
public $uploadDir = 'files/uploads/';
/**
* The final formatted directory.
*
* @access public
* @var string
*/
public $finalDir;
/**
* The accepted file/mime types; imported from config.
*
* @access protected
* @var array
*/
protected $_mimeTypes = array();
/**
* Holds the current $_FILES data.
*
* @access protected
* @var array
*/
protected $_data = array();
/**
* Holds the the logged uploads.
*
* @access protected
* @var array
*/
protected $_logs = array();
/**
* The current file being processed.
*
* @access protected
* @var string
*/
protected $_current;
/**
* Load the controllers file data into the component.
*
* @access public
* @param object $Controller
* @param array $settings
* @return void
*/
public function initialize($Controller, array $settings = array()) {
$this->_mimeTypes = Configure::read('Uploader.mimeTypes');
if (!$this->_loadExtension('gd')) {
$this->enableUpload = false;
trigger_error('Uploader.Uploader::initialize(): GD image library is not installed.', E_USER_WARNING);
}
$data = $Controller->data;
unset($data['_Token']);
$this->_set($settings);
$this->_parseData($data, null, count($data));
}
/**
* Set our ini settings for future use.
*
* @access public
* @uses Folder
* @param object $Controller
* @return void
*/
public function startup($Controller) {
$fileUploads = ini_get('file_uploads');
if (!$fileUploads) {
$this->enableUpload = false;
} else if (!is_bool($this->enableUpload)) {
$this->enableUpload = $fileUploads;
}
if (empty($this->maxFileSize)) {
$this->maxFileSize = ini_get('upload_max_filesize');
}
$byte = preg_replace('/[^0-9]/i', '', $this->maxFileSize);
$last = $this->bytes($this->maxFileSize, 'byte');
if ($last == 'T' || $last == 'TB') {
$multiplier = 1;
$execTime = 20;
} else if ($last == 'G' || $last == 'GB') {
$multiplier = 3;
$execTime = 10;
} else if ($last == 'M' || $last == 'MB') {
$multiplier = 5;
$execTime = 5;
} else {
$multiplier = 10;
$execTime = 3;
}
ini_set('memory_limit', (($byte * $multiplier) * $multiplier) . $last);
ini_set('post_max_size', ($byte * $multiplier) . $last);
ini_set('upload_tmp_dir', $this->tempDir);
ini_set('upload_max_filesize', $this->maxFileSize);
ini_set('max_execution_time', ($execTime * 10));
ini_set('max_input_time', ($execTime * 10));
if (!is_writable($this->tempDir)) {
$Folder = new Folder();
$Folder->chmod($this->tempDir, 0777, false);
}
$this->baseDir = str_replace('\\', '/', $this->baseDir);
}
/**
* Adds a mime type to the list of allowed types.
*
* @access public
* @param string $group
* @param string $ext
* @param string $type
* @return void
*/
public function addMimeType($group = null, $ext = null, $type = null) {
if (empty($group)) {
$group = 'misc';
}
if (!empty($ext) && !empty($type)) {
$this->_mimeTypes[$group][$ext] = $type;
}
}
/**
* Return the bytes based off the shorthand notation.
*
* @access public
* @param int $size
* @param string $return
* @return string
*/
public function bytes($size, $return = null) {
if (!is_numeric($size)) {
$byte = preg_replace('/[^0-9]/i', '', $size);
$last = mb_strtoupper(preg_replace('/[^a-zA-Z]/i', '', $size));
if ($return == 'byte') {
return $last;
}
switch ($last) {
case 'T': case 'TB': $byte *= 1024;
case 'G': case 'GB': $byte *= 1024;
case 'M': case 'MB': $byte *= 1024;
case 'K': case 'KB': $byte *= 1024;
}
$size = $byte;
}
if ($return == 'size') {
return $size;
}
$sizes = array('YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B');
$total = count($sizes);
while ($total-- && $size > 1024) {
$size /= 1024;
}
$bytes = round($size, 0) .' '. $sizes[$total];
return $bytes;
}
/**
* Check the destination folder. If it does not exist or isn't writable, fix it!
*
* @access public
* @uses Folder
* @return void
*/
public function checkDirectory() {
$Folder = new Folder();
$uploadDir = trim($this->uploadDir, '/');
$finalDir = $this->formatPath($uploadDir .'/');
if (!is_dir($finalDir)) {
$dirParts = explode('/', $uploadDir);
$dirCurrent = rtrim($this->baseDir, '/');
foreach ($dirParts as $part) {
$Folder->create($dirCurrent . DS . $part, 0777);
$dirCurrent .= DS . $part;
}
} else if (!is_writable($finalDir)) {
$Folder->chmod($finalDir, 0777, false);
}
$this->finalDir = $finalDir;
}
/**
* Check the extension and mimetype against the supported list. If found, return the grouping.
*
* @access public
* @param string $ext
* @param string $type
* @return mixed
*/
public function checkMimeType($ext, $type) {
$validExt = false;
$validMime = false;
$currType = mb_strtolower($type);
foreach ($this->_mimeTypes as $grouping => $mimes) {
if (isset($mimes[$ext])) {
$validExt = true;
}
foreach ($mimes as $mimeExt => $mimeType) {
if (($currType == $mimeType) || (is_array($mimeType) && in_array($currType, $mimeType))) {
$validMime = true;
break 2;
}
}
}
if ($validExt && $validMime) {
return $grouping;
}
return false;
}
/**
* Crops a photo, resizes first depending on which side is larger.
*
* @access public
* @param array $options
* - location: Which area of the image should be grabbed for the crop: center, left, right, top, bottom
* - width,
* - height: The width and height to resize the image to before cropping
* - append: What should be appended to the end of the filename (defaults to dimensions if not set)
* - prepend: What should be prepended to the front of the filename
* - quality: The quality of the image
* @param boolean $explicit
* @return mixed
*/
public function crop(array $options = array(), $explicit = false) {
if ($this->_data[$this->_current]['group'] != 'image' || $this->enableUpload === false) {
return false;
}
$options = $options + array('location' => self::LOC_CENTER, 'quality' => 100, 'width' => null, 'height' => null, 'append' => null, 'prepend' => null);
$width = $this->_data[$this->_current]['width'];
$height = $this->_data[$this->_current]['height'];
$src_x = 0;
$src_y = 0;
$dest_w = $width;
$dest_h = $height;
$location = $options['location'];
if (is_numeric($options['width']) && is_numeric($options['height'])) {
$newWidth = $options['width'];
$newHeight = $options['height'];
if ($width > $height) {
$dest_h = $options['height'];
$dest_w = round(($width / $height) * $options['height']);
} else if ($height > $width) {
$dest_w = $options['width'];
$dest_h = round(($height / $width) * $options['width']);
}
} else {
if ($width > $height) {
$newWidth = $height;
$newHeight = $height;
} else {
$newWidth = $width;
$newHeight = $width;
}
$dest_h = $newHeight;
$dest_w = $newWidth;
}
if ($dest_w > $dest_h) {
if ($location == self::LOC_CENTER) {
$src_x = ceil(($width - $height) / 2);
$src_y = 0;
} else if ($location == self::LOC_BOT || $location == self::LOC_RIGHT) {
$src_x = ($width - $height);
$src_y = 0;
}
} else if ($dest_h > $dest_w) {
if ($location == self::LOC_CENTER) {
$src_x = 0;
$src_y = ceil(($height - $width) / 2);
} else if ($location == self::LOC_BOT || $location == self::LOC_RIGHT) {
$src_x = 0;
$src_y = ($height - $width);
}
}
$append = '_cropped_'. $newWidth .'x'. $newHeight;
if ($options['append'] !== false && empty($options['append'])) {
$options['append'] = $append;
}
$transform = array(
'width' => $newWidth,
'height' => $newHeight,
'source_x' => $src_x,
'source_y' => $src_y,
'source_w' => $width,
'source_h' => $height,
'dest_w' => $dest_w,
'dest_h' => $dest_h,
'target' => $this->setDestination($this->_data[$this->_current]['name'], true, $options, false),
'quality' => $options['quality']
);
if ($this->transform($transform)) {
return $this->_returnData($transform, $append, $explicit);
}
return false;
}
/**
* Deletes a file, path is relative to webroot/.
*
* @access public
* @param string $path
* @return boolean
*/
public function delete($path) {
$path = $this->formatPath($path);
if (is_file($path)) {
clearstatcache();
return unlink($path);
}
return false;
}
/**
* Get the dimensions of an image.
*
* @access public
* @uses HttpSocket
* @param string $path
* @return array
*/
public function dimensions($path) {
$dim = array();
foreach (array($path, $this->formatPath($path)) as $newPath) {
$data = @getimagesize($path);
if (!empty($data) && is_array($data)) {
$dim = array(
'width' => $data[0],
'height' => $data[1],
'type' => $data['mime']
);
}
}
if (empty($dim)) {
$Http = new HttpSocket();
$data = $Http->request($path);
$image = @imagecreatefromstring($data);
$dim = array(
'width' => @imagesx($image),
'height' => @imagesy($image),
'type' => $this->mimeType($path)
);
}
return $dim;
}
/**
* Get the extension.
*
* @access public
* @param string $file
* @return string
*/
public function ext($file) {
return mb_strtolower(trim(mb_strrchr($file, '.'), '.'));
}
/**
* Flips an image in 3 possible directions.
*
* @access public
* @param array $options
* - dir: The direction the image should be flipped
* - append: What should be appended to the end of the filename (defaults to flip direction if not set)
* - prepend: What should be prepended to the front of the filename
* - quality: The quality of the image
* @param boolean $explicit
* @return string
*/
public function flip(array $options = array(), $explicit = false) {
if ($this->_data[$this->_current]['group'] != 'image' || $this->enableUpload === false) {
return false;
}
$options = $options + array('dir' => self::DIR_VERT, 'quality' => 100, 'append' => null, 'prepend' => null);
$width = $this->_data[$this->_current]['width'];
$height = $this->_data[$this->_current]['height'];
$src_x = 0;
$src_y = 0;
$src_w = $width;
$src_h = $height;
switch ($options['dir']) {
// vertical
case self::DIR_VERT:
$src_y = --$height;
$src_h = -$height;
$adir = 'vert';
break;
// horizontal
case self::DIR_HORI:
$src_x = --$width;
$src_w = -$width;
$adir = 'hor';
break;
// both
case self::DIR_BOTH:
$src_x = --$width;
$src_y = --$height;
$src_w = -$width;
$src_h = -$height;
$adir = 'both';
break;
default:
return false;
break;
}
$append = '_flip_'. $adir;
if ($options['append'] !== false && empty($options['append'])) {
$options['append'] = $append;
}
$transform = array(
'width' => $width,
'height' => $height,
'source_x' => $src_x,
'source_y' => $src_y,
'source_w' => $src_w,
'source_h' => $src_h,
'target' => $this->setDestination($this->_data[$this->_current]['name'], true, $options, false),
'quality' => $options['quality']
);
if ($this->transform($transform)) {
return $this->_returnData($transform, $append, $explicit);
}
return false;
}
/**
* Determines the name of the file.
*
* @access public
* @param string $name
* @param string $append
* @param string $prepend
* @param boolean $truncate
* @return void
*/
public function formatFilename($name = '', $append = '', $prepend = '', $truncate = true) {
if (empty($name)) {
$name = $this->_data[$this->_current]['name'];
}
$ext = $this->ext($name);
if (empty($ext)) {
$ext = $this->_data[$this->_current]['ext'];
}
$name = str_replace('.'. $ext, '', $name);
$name = preg_replace(array('/[^-_.a-zA-Z0-9\s]/i', '/[\s]/'), array('', '_'), $name);
if (is_numeric($this->maxNameLength) && $truncate) {
if (mb_strlen($name) > $this->maxNameLength) {
$name = mb_substr($name, 0, $this->maxNameLength);
}
}
$append = (string)$append;
$prepend = (string)$prepend;
if (!empty($append)) {
$append = preg_replace(array('/[^-_.a-zA-Z0-9\s]/i', '/[\s]/'), array('', '_'), $append);
$name = $name . $append;
}
if (!empty($prepend)) {
$prepend = preg_replace(array('/[^-_.a-zA-Z0-9\s]/i', '/[\s]/'), array('', '_'), $prepend);
$name = $prepend . $name;
}
$name = $name .'.'. $ext;
$name = trim($name, '/');
return $name;
}
/**
* Return the path with the base directory if it is absent.
*
* @access public
* @param string $path
* @return string
*/
public function formatPath($path) {
if (substr($this->baseDir, -1) != '/') {
$this->baseDir .= '/';
}
if (strpos($path, $this->baseDir) === false) {
$path = $this->baseDir . $path;
}
return $path;
}
/**
* Import a file from the local filesystem and create a copy of it. Requires a full absolute path.
*
* @access public
* @param string $path
* @param array $options
* - name: What should the filename be changed to
* - overwrite: Should we overwrite the existant file with the same name?
* - delete: Delete the original file after importing
* @return mixed - Array on success, false on failure
*/
public function import($path, array $options = array()) {
if (!$this->enableUpload || !is_file($path)) {
return false;
} else {
$this->checkDirectory();
}
$options = $options + array('name' => null, 'overwrite' => false, 'delete' => false);
$this->_current = basename($path);
$this->_data[$this->_current]['path'] = $path;
$this->_data[$this->_current]['type'] = $this->mimeType($path);
$this->_data[$this->_current]['ext'] = $this->ext($path);
// Validate everything
if ($this->_validates(true)) {
if ($this->_data[$this->_current]['group'] == 'image') {
$dimensions = $this->dimensions($path);
$this->_data[$this->_current]['width'] = $dimensions['width'];
$this->_data[$this->_current]['height'] = $dimensions['height'];
}
} else {
return false;
}
// Make a copy of the local file
$dest = $this->setDestination($options['name'], $options['overwrite']);
if (copy($path, $dest)) {
$this->_data[$this->_current]['uploaded'] = date('Y-m-d H:i:s');
$this->_data[$this->_current]['filesize'] = $this->bytes(filesize($path));
if ($options['delete']) {
@unlink($path);
}
} else {
return false;
}
chmod($dest, 0777);
return $this->_returnData();
}
/**
* Import a file from an external remote URL. Must be an absolute URL.
*
* @access public
* @uses HttpSocket
* @param string $path
* @param array $options
* - name: What should the filename be changed to
* - overwrite: Should we overwrite the existant file with the same name?
* @return mixed - Array on success, false on failure
*/
public function importRemote($url, array $options = array()) {
if (!$this->enableUpload) {
return false;
} else {
$this->checkDirectory();
}
$options = $options + array('name' => null, 'overwrite' => false);
$this->_current = basename($url);
$this->_data[$this->_current]['path'] = $url;
$this->_data[$this->_current]['type'] = $this->mimeType($url);
$this->_data[$this->_current]['ext'] = $this->ext($url);
// Validate everything
if (!$this->_validates(true)) {
return false;
}
// Make a copy of the remote file
$dest = $this->setDestination($options['name'], $options['overwrite']);
$Http = new HttpSocket();
if (file_put_contents($dest, $Http->request($url))) {
$this->_data[$this->_current]['uploaded'] = date('Y-m-d H:i:s');
$this->_data[$this->_current]['filesize'] = $this->bytes(filesize($dest));
if ($this->_data[$this->_current]['group'] == 'image') {
$dimensions = $this->dimensions($dest);
$this->_data[$this->_current]['width'] = $dimensions['width'];
$this->_data[$this->_current]['height'] = $dimensions['height'];
}
} else {
return false;
}
chmod($dest, 0777);
return $this->_returnData();
}
/**
* Returns the mimetype of a given file.
*
* @access public
* @param string $path
* @return string
*/
public function mimeType($path) {
if (function_exists('mime_content_type') && is_file($path)) {
return mime_content_type($path);
}
$ext = $this->ext($path);
$type = null;
foreach ($this->_mimeTypes as $group => $mimes) {
if (in_array($ext, array_keys($mimes))) {
$type = $this->_mimeTypes[$group][$ext];
break;
}
}
if (is_array($type)) {
$type = $type[0];
}
return $type;
}
/**
* Move a file to another destination.
*
* @access public
* @param string $origPath
* @param string $destPath
* @param boolean $overwrite
* @return boolean
*/
public function move($origPath, $destPath, $overwrite = false) {
$destFull = $this->formatPath($destPath);
$origFull = $this->formatPath($origPath);
if (($origPath === $destPath) || !file_exists($origFull) || !is_writable(dirname($destFull))) {
return false;
}
if ($overwrite) {
if (file_exists($destFull)) {
$this->delete($destPath);
}
} else {
if (file_exists($destFull)) {
$destination = $this->setDestination(basename($destPath), false, array('append' => '_moved'), false);
rename($destFull, $destination);
}
}
return rename($origFull, $destFull);
}
/**
* Rename a file / Alias for move().
*
* @access public
* @param string $origPath
* @param string $destPath
* @param boolean $overwrite
* @return boolean
*/
public function rename($origPath, $destPath, $overwrite = false) {
return $this->move($origPath, $destPath, $overwrite);
}
/**
* Resizes and image based off a previously uploaded image.
*
* @access public
* @param array $options
* - width,
* - height: The width and height to resize the image to
* - quality: The quality of the image
* - append: What should be appended to the end of the filename (defaults to dimensions if not set)
* - prepend: What should be prepended to the front of the filename
* - expand: Should the image be resized if the dimension is greater than the original dimension
* @param boolean $explicit
* @return string
*/
public function resize(array $options, $explicit = false) {
if ($this->_data[$this->_current]['group'] != 'image' || $this->enableUpload === false) {
return false;
}
$options = $options + array('width' => null, 'height' => null, 'quality' => 100, 'append' => null, 'prepend' => null, 'expand' => false);
$width = $this->_data[$this->_current]['width'];
$height = $this->_data[$this->_current]['height'];
$maxWidth = $options['width'];
$maxHeight = $options['height'];
if ($options['expand'] === false && (($maxWidth > $width) || ($maxHeight > $height))) {
$newWidth = $width;
$newHeight = $height;
} else {
if (is_numeric($maxWidth) && empty($maxHeight)) {
$newWidth = $maxWidth;
$newHeight = round(($height / $width) * $maxWidth);
} else if (is_numeric($maxHeight) && empty($maxWidth)) {
$newWidth = round(($width / $height) * $maxHeight);
$newHeight = $maxHeight;
} else if (is_numeric($maxHeight) && is_numeric($maxWidth)) {
$newWidth = $maxWidth;
$newHeight = $maxHeight;
} else {
return false;
}
}
$newWidth = round($newWidth);
$newHeight = round($newHeight);
$append = '_'. $newWidth .'x'. $newHeight;
if ($options['append'] !== false && empty($options['append'])) {
$options['append'] = $append;
}
$transform = array(
'width' => $newWidth,
'height' => $newHeight,
'target' => $this->setDestination($this->_data[$this->_current]['name'], true, $options, false),
'quality' => $options['quality']
);
if ($this->transform($transform)) {
return $this->_returnData($transform, $append, $explicit);
}
return false;
}
/**
* Scale the image based on a percentage.
*
* @access public
* @param array $options
* - percent: What percentage should the image be scaled to, defaults to %50 (.5)
* - append: What should be appended to the end of the filename (defaults to dimensions if not set)
* - prepend: What should be prepended to the front of the filename
* - quality: The quality of the image
* @param boolean $explicit
* @return string
*/
public function scale(array $options = array(), $explicit = false) {
if ($this->_data[$this->_current]['group'] != 'image' || $this->enableUpload === false) {
return false;
}
$options = $options + array('percent' => .5, 'quality' => 100, 'append' => null, 'prepend' => null);
$width = round($this->_data[$this->_current]['width'] * $options['percent']);
$height = round($this->_data[$this->_current]['height'] * $options['percent']);
$append = '_scaled_'. $width .'x'. $height;
if ($options['append'] !== false && empty($options['append'])) {
$options['append'] = $append;
}
$transform = array(
'width' => $width,
'height' => $height,
'target' => $this->setDestination($this->_data[$this->_current]['name'], true, $options, false),
'quality' => $options['quality']
);
if ($this->transform($transform)) {
return $this->_returnData($transform, $append, $explicit);
}
return false;
}
/**
* Determine the filename and path of the file.
*
* @access public
* @param string $name
* @param boolean $overwrite
* @param array $options
* @param boolean $update
* @return string
*/
public function setDestination($name = '', $overwrite = false, array $options = array(), $update = true) {
$append = isset($options['append']) ? $options['append'] : '';
$prepend = isset($options['prepend']) ? $options['prepend'] : '';
$name = $this->formatFilename($name, $append, $prepend);
$dest = $this->finalDir . $name;
if (file_exists($dest) && !$overwrite) {
$no = 1;
while (file_exists($this->finalDir . $this->formatFilename($name, $append . $no, $prepend))) {
$no++;
}
$name = $this->formatFilename($name, $append . $no, $prepend);
$dest = $this->finalDir . $name;
}
if ($update) {
$this->_data[$this->_current]['name'] = $name;
$this->_data[$this->_current]['path'] = $dest;
}
return $dest;
}
/**
* Main function for transforming an image.
*
* @access public
* @param array $options
* @return boolean
*/
public function transform(array $options) {
$options = $options + array('dest_x' => 0, 'dest_y' => 0, 'source_x' => 0, 'source_y' => 0, 'dest_w' => null, 'dest_h' => null, 'source_w' => $this->_data[$this->_current]['width'], 'source_h' => $this->_data[$this->_current]['height'], 'quality' => 100);
$original = $this->_data[$this->_current]['path'];
$mimeType = $this->_data[$this->_current]['type'];
if (empty($options['dest_w'])) {
$options['dest_w'] = $options['width'];
}
if (empty($options['dest_h'])) {
$options['dest_h'] = $options['height'];
}
// Create an image to work with
switch ($mimeType) {
case 'image/gif':
$source = imagecreatefromgif($original);
break;
case 'image/png':
$source = imagecreatefrompng($original);
break;
case 'image/jpg':
case 'image/jpeg':
case 'image/pjpeg':
$source = imagecreatefromjpeg($original);
break;
default:
return false;
break;
}
$target = imagecreatetruecolor($options['width'], $options['height']);
// If gif,png allow transparencies
if ($mimeType == 'image/gif' || $mimeType == 'image/png') {
imagealphablending($target, false);
imagesavealpha($target, true);
imagefilledrectangle($target, 0, 0, $options['width'], $options['height'], imagecolorallocatealpha($target, 255, 255, 255, 127));
}
// Lets take our source and apply it to the temporary file and resize
imagecopyresampled($target, $source, $options['dest_x'], $options['dest_y'], $options['source_x'], $options['source_y'], $options['dest_w'], $options['dest_h'], $options['source_w'], $options['source_h']);
// Now write the resized image to the server
switch ($mimeType) {
case 'image/gif':
imagegif($target, $options['target']);
break;
case 'image/png':
imagepng($target, $options['target']);
break;
case 'image/jpg':
case 'image/jpeg':
case 'image/pjpeg':
imagejpeg($target, $options['target'], $options['quality']);
break;
default:
imagedestroy($source);
imagedestroy($target);
return false;
break;
}
// Clear memory
imagedestroy($source);
imagedestroy($target);
return true;
}
/**
* Upload the file to the destination.
*
* @access public
* @param string $file
* @param array $options
* - name: What should the filename be changed to
* - overwrite: Should we overwrite the existant file with the same name?
* - multiple: Is this method being called from uploadAll()
* @return mixed - Array on success, false on failure
*/
public function upload($file, array $options = array()) {
$options = $options + array('name' => null, 'overwrite' => false, 'multiple' => false);
if (!$options['multiple']) {
if (!$this->enableUpload) {
return false;
} else {
$this->checkDirectory();
}
}
if (isset($this->_data[$file])) {
$this->_current = $file;
$this->_data[$this->_current]['filesize'] = $this->bytes($this->_data[$this->_current]['size']);
$this->_data[$this->_current]['ext'] = $this->ext($this->_data[$this->_current]['name']);
} else {
return false;
}
// Validate everything
if ($this->_validates()) {
if ($this->_data[$this->_current]['group'] == 'image') {
$dimensions = $this->dimensions($this->_data[$this->_current]['tmp_name']);
$this->_data[$this->_current]['width'] = $dimensions['width'];
$this->_data[$this->_current]['height'] = $dimensions['height'];
}
} else {
return false;
}
// Upload! Try both functions, one should work!
$dest = $this->setDestination($options['name'], $options['overwrite']);
if (move_uploaded_file($this->_data[$this->_current]['tmp_name'], $dest)) {
$this->_data[$this->_current]['uploaded'] = date('Y-m-d H:i:s');
} else if (copy($this->_data[$this->_current]['tmp_name'], $dest)) {
$this->_data[$this->_current]['uploaded'] = date('Y-m-d H:i:s');
} else {
return false;
}
chmod($dest, 0777);
return $this->_returnData();
}
/**
* Upload multiple files, but have less configuration options and no transforming.
*
* @access public
* @param array $fields
* @param boolean $overwrite
* @param boolean $rollback
* @return array
*/
public function uploadAll(array $fields = array(), $overwrite = false, $rollback = true) {
if (!$this->enableUpload) {
return false;
} else {
$this->checkDirectory();
}
if (empty($fields) || !$fields) {
$fields = array_keys($this->_data);
}
$data = array();
$fail = false;
if (!empty($fields)) {
foreach ($fields as $field) {
if (isset($this->_data[$field])) {
$upload = $this->upload($field, array('overwrite' => $overwrite, 'multiple' => true));
if (!empty($upload)) {
$data[$field] = $upload;
} else {
$fail = true;
break;
}
}
}
}
if ($fail) {
if ($rollback && !empty($data)) {
foreach ($data as $file) {
$this->delete($file['path']);
}
}
return false;
}
return $data;
}
/**
* Attempt to load a missing extension.
*
* @access protected
* @param string $name
* @return boolean
*/
protected function _loadExtension($name) {
if (!extension_loaded($name)) {
@dl((PHP_SHLIB_SUFFIX == 'dll' ? 'php_' : '') . $name .'.'. PHP_SHLIB_SUFFIX);
}
return extension_loaded($name);
}
/**
* Parses the controller data to only grab $_FILES related data.
*
* @access protected
* @param array $data
* @param string $model
* @param int $count
* @return void
*/
protected function _parseData($data, $model = null, $count = 1) {
if (is_array($data)) {
foreach ($data as $field => $value) {
if (is_array($value) && isset($value['tmp_name'])) {
if ($count == 1) {
$slug = $field;
} else {
$slug = $model .'.'. $field;
}
$this->_data[$slug] = $value;
} else {
$this->_parseData($value, $field, $count);
}
}
}
}
/**
* Formates and returns the data array.
*
* @access protected
* @param array $data
* @param string $append
* @param boolean $explicit
* @return array
*/
protected function _returnData($data = '', $append = '', $explicit = false) {
if (!empty($data) && !empty($append)) {
$this->_data[$this->_current]['path_'. trim($append, '_')] = $data['target'];
$this->_logs[$this->_current]['path_'. trim($append, '_')] = $data['target'];
chmod($data['target'], 0777);
$path = str_replace($this->baseDir, '/', $data['target']);
if ($explicit) {
return array(
'path' => $path,
'width' => $data['width'],
'height' => $data['height']
);
} else {
return $path;
}
} else {
$data = $this->_data[$this->_current];
unset($data['tmp_name'], $data['error']);
foreach ($data as $key => $value) {
if (strpos($key, 'path') !== false) {
$data[$key] = str_replace($this->baseDir, '/', $data[$key]);
}
}
$this->_logs[$this->_current] = $data;
return $data;
}
}
/**
* Does validation on the current upload.
*
* @access protected
* @param boolean $import
* @return boolean
*/
protected function _validates($import = false) {
$current = $this->_data[$this->_current];
$grouping = $this->checkMimeType($current['ext'], $current['type']);
if ($grouping) {
$this->_data[$this->_current]['group'] = $grouping;
} else if (!$import) {
return false;
}
// Only validate uploaded files, not imported
if (!$import) {
if (($current['error'] > 0) || !is_uploaded_file($current['tmp_name']) || !is_file($current['tmp_name'])) {
return false;
}
// Requires the ClamAV module to be installed
if ($this->scanFile && $this->_loadExtension('clamav')) {
cl_setlimits(5, 1000, 200, 0, 10485760);
if (cl_scanfile($current['tmp_name'])) {
return false;
}
}
}
return true;
}
}
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/controllers/components/uploader.php | PHP | gpl3 | 32,657 |
<?php
/**
* S3 Transfer Component
*
* A component that can transfer a file into Amazon's storage bucket (AS3) - defined in the config.
*
* @author Miles Johnson - http://milesj.me
* @copyright Copyright 2006-2011, Miles Johnson, Inc.
* @license http://opensource.org/licenses/mit-license.php - Licensed under The MIT License
* @link http://milesj.me/code/cakephp/uploader
*/
App::import(array(
'type' => 'Vendor',
'name' => 'Uploader.S3',
'file' => 'S3.php'
));
class S3TransferComponent extends Object {
/**
* Components.
*
* @access public
* @var array
*/
public $components = array('Uploader.Uploader');
/**
* The bucket to use globally. Can be overwritten in each method.
*
* @access public
* @var string
*/
public $bucket;
/**
* Your S3 access key.
*
* @access public
* @var boolean
*/
public $accessKey;
/**
* Your S3 secret key.
*
* @access public
* @var boolean
*/
public $secretKey;
/**
* Should the request use SSL?
*
* @access public
* @var boolean
*/
public $useSsl = true;
/**
* Is the behavior configured correctly and usable.
*
* @access private
* @var boolean
*/
private $__enabled = false;
/**
* Initialize transfer and classes.
*
* @access public
* @param object $Controller
* @return boolean
*/
public function startup($Controller) {
if (empty($this->accessKey) && empty($this->secretKey)) {
trigger_error('Uploader.S3Transfer::setup(): You must enter an Amazon S3 access key and secret key.', E_USER_WARNING);
} else if (!function_exists('curl_init')) {
trigger_error('Uploader.S3Transfer::setup(): You must have the cURL extension loaded to use the S3Transfer.', E_USER_WARNING);
} else {
$this->S3 = new S3($this->accessKey, $this->secretKey, $this->useSsl);
$this->__enabled = true;
}
}
/**
* Delete an object from a bucket.
*
* @access public
* @param string $url - Full URL or Object file name
* @param string $bucket
* @return boolean
*/
public function delete($url, $bucket = null) {
if ($this->__enabled) {
$bucket = !empty($bucket) ? $bucket : $this->bucket;
return $this->S3->deleteObject($bucket, basename($url));
}
return false;
}
/**
* Get a certain amount of objects from a bucket.
*
* @access public
* @param int $limit
* @param string $bucket
* @return array
*/
public function getBucket($limit = 15, $bucket = null) {
if ($this->__enabled) {
$bucket = !empty($bucket) ? $bucket : $this->bucket;
return $this->S3->getBucket($bucket, null, null, $limit);
}
return false;
}
/**
* List out all the buckets under this S3 account.
*
* @access public
* @param boolean $detailed
* @return array
*/
public function listBuckets($detailed = true) {
if ($this->__enabled) {
return $this->S3->listBuckets($detailed);
}
return false;
}
/**
* Transfer an object to the storage bucket.
*
* @access public
* @param string $path
* @param boolean $delete
* @param string $bucket
* @return string
*/
public function transfer($path, $delete = true, $bucket = null) {
if (empty($path)) {
trigger_error('Uploader.S3Transfer::transfer(): File path missing, please try again.', E_USER_WARNING);
return false;
}
if ($this->__enabled) {
$bucket = !empty($bucket) ? $bucket : $this->bucket;
$name = basename($path);
if ($this->S3->putObjectFile($this->Uploader->formatPath($fullPath), $bucket, $name, S3::ACL_PUBLIC_READ)) {
if ($delete) {
$this->Uploader->delete($path);
}
return 'http://'. $bucket .'.s3.amazonaws.com/'. $name;
}
}
return false;
}
}
| 0001-bee | trunk/cakephp2/app/Plugin/uploader/controllers/components/s3_transfer.php | PHP | gpl3 | 3,669 |
<?php
/**
* Index
*
* The Front Controller for handling every request
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.webroot
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Use the DS to separate the directories in other defines
*/
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
* When using custom settings be sure to use the DS and do not add a trailing DS.
*/
/**
* The full path to the directory which holds "app", WITHOUT a trailing DS.
*
*/
if (!defined('ROOT')) {
define('ROOT', dirname(dirname(dirname(__FILE__))));
}
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
* Un-comment this line to specify a fixed path to CakePHP.
* This should point at the directory containing `Cake`.
*
* For ease of development CakePHP uses PHP's include_path. If you
* cannot modify your include_path set this value.
*
* Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
*/
//define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
/**
* Editing below this line should NOT be necessary.
* Change at your own risk.
*
*/
if (!defined('WEBROOT_DIR')) {
define('WEBROOT_DIR', basename(dirname(__FILE__)));
}
if (!defined('WWW_ROOT')) {
define('WWW_ROOT', dirname(__FILE__) . DS);
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
if (function_exists('ini_set')) {
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
}
if (!include('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
} else {
if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
}
if (!empty($failed)) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') {
return;
}
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
| 0001-bee | trunk/cakephp2/app/webroot/index.php | PHP | gpl3 | 2,974 |
<?php
/**
* Web Access Frontend for TestSuite
*
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing
* @package app.webroot
* @since CakePHP(tm) v 1.2.0.4433
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
set_time_limit(0);
ini_set('display_errors', 1);
/**
* Use the DS to separate the directories in other defines
*/
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
* When using custom settings be sure to use the DS and do not add a trailing DS.
*/
/**
* The full path to the directory which holds "app", WITHOUT a trailing DS.
*
*/
if (!defined('ROOT')) {
define('ROOT', dirname(dirname(dirname(__FILE__))));
}
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
/**
* The absolute path to the "Cake" directory, WITHOUT a trailing DS.
*
* For ease of development CakePHP uses PHP's include_path. If you
* need to cannot modify your include_path, you can set this path.
*
* Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
*/
//define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
/**
* Editing below this line should not be necessary.
* Change at your own risk.
*
*/
if (!defined('WEBROOT_DIR')) {
define('WEBROOT_DIR', basename(dirname(__FILE__)));
}
if (!defined('WWW_ROOT')) {
define('WWW_ROOT', dirname(__FILE__) . DS);
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
if (function_exists('ini_set')) {
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
}
if (!include('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
} else {
if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
}
if (!empty($failed)) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
if (Configure::read('debug') < 1) {
die(__d('cake_dev', 'Debug setting does not allow access to this url.'));
}
require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
| 0001-bee | trunk/cakephp2/app/webroot/test.php | PHP | gpl3 | 2,816 |
/*
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
*/
/*
Forces backgrounds to span full width,
even if there is horizontal scrolling.
Increase this if your layout is wider.
Note: IE6 works fine without this fix.
*/
body {
min-width: 960px;
}
/* `Container
----------------------------------------------------------------------------------------------------*/
.container_12,
.container_16 {
margin-left: auto;
margin-right: auto;
width: 960px;
}
/* `Grid >> Global
----------------------------------------------------------------------------------------------------*/
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12,
.grid_13,
.grid_14,
.grid_15,
.grid_16 {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
.push_1, .pull_1,
.push_2, .pull_2,
.push_3, .pull_3,
.push_4, .pull_4,
.push_5, .pull_5,
.push_6, .pull_6,
.push_7, .pull_7,
.push_8, .pull_8,
.push_9, .pull_9,
.push_10, .pull_10,
.push_11, .pull_11,
.push_12, .pull_12,
.push_13, .pull_13,
.push_14, .pull_14,
.push_15, .pull_15 {
position: relative;
}
.container_12 .grid_3,
.container_16 .grid_4 {
width: 220px;
}
.container_12 .grid_6,
.container_16 .grid_8 {
width: 460px;
}
.container_12 .grid_9,
.container_16 .grid_12 {
width: 700px;
}
.container_12 .grid_12,
.container_16 .grid_16 {
width: 940px;
}
/* `Grid >> Children (Alpha ~ First, Omega ~ Last)
----------------------------------------------------------------------------------------------------*/
.alpha {
margin-left: 0;
}
.omega {
margin-right: 0;
}
/* `Grid >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .grid_1 {
width: 60px;
}
.container_12 .grid_2 {
width: 140px;
}
.container_12 .grid_4 {
width: 300px;
}
.container_12 .grid_5 {
width: 380px;
}
.container_12 .grid_7 {
width: 540px;
}
.container_12 .grid_8 {
width: 620px;
}
.container_12 .grid_10 {
width: 780px;
}
.container_12 .grid_11 {
width: 860px;
}
/* `Grid >> 16 Columns
----------------------------------------------------------------------------------------------------*/
.container_16 .grid_1 {
width: 40px;
}
.container_16 .grid_2 {
width: 100px;
}
.container_16 .grid_3 {
width: 160px;
}
.container_16 .grid_5 {
width: 280px;
}
.container_16 .grid_6 {
width: 340px;
}
.container_16 .grid_7 {
width: 400px;
}
.container_16 .grid_9 {
width: 520px;
}
.container_16 .grid_10 {
width: 580px;
}
.container_16 .grid_11 {
width: 640px;
}
.container_16 .grid_13 {
width: 760px;
}
.container_16 .grid_14 {
width: 820px;
}
.container_16 .grid_15 {
width: 880px;
}
/* `Prefix Extra Space >> Global
----------------------------------------------------------------------------------------------------*/
.container_12 .prefix_3,
.container_16 .prefix_4 {
padding-left: 240px;
}
.container_12 .prefix_6,
.container_16 .prefix_8 {
padding-left: 480px;
}
.container_12 .prefix_9,
.container_16 .prefix_12 {
padding-left: 720px;
}
/* `Prefix Extra Space >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .prefix_1 {
padding-left: 80px;
}
.container_12 .prefix_2 {
padding-left: 160px;
}
.container_12 .prefix_4 {
padding-left: 320px;
}
.container_12 .prefix_5 {
padding-left: 400px;
}
.container_12 .prefix_7 {
padding-left: 560px;
}
.container_12 .prefix_8 {
padding-left: 640px;
}
.container_12 .prefix_10 {
padding-left: 800px;
}
.container_12 .prefix_11 {
padding-left: 880px;
}
/* `Prefix Extra Space >> 16 Columns
----------------------------------------------------------------------------------------------------*/
.container_16 .prefix_1 {
padding-left: 60px;
}
.container_16 .prefix_2 {
padding-left: 120px;
}
.container_16 .prefix_3 {
padding-left: 180px;
}
.container_16 .prefix_5 {
padding-left: 300px;
}
.container_16 .prefix_6 {
padding-left: 360px;
}
.container_16 .prefix_7 {
padding-left: 420px;
}
.container_16 .prefix_9 {
padding-left: 540px;
}
.container_16 .prefix_10 {
padding-left: 600px;
}
.container_16 .prefix_11 {
padding-left: 660px;
}
.container_16 .prefix_13 {
padding-left: 780px;
}
.container_16 .prefix_14 {
padding-left: 840px;
}
.container_16 .prefix_15 {
padding-left: 900px;
}
/* `Suffix Extra Space >> Global
----------------------------------------------------------------------------------------------------*/
.container_12 .suffix_3,
.container_16 .suffix_4 {
padding-right: 240px;
}
.container_12 .suffix_6,
.container_16 .suffix_8 {
padding-right: 480px;
}
.container_12 .suffix_9,
.container_16 .suffix_12 {
padding-right: 720px;
}
/* `Suffix Extra Space >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .suffix_1 {
padding-right: 80px;
}
.container_12 .suffix_2 {
padding-right: 160px;
}
.container_12 .suffix_4 {
padding-right: 320px;
}
.container_12 .suffix_5 {
padding-right: 400px;
}
.container_12 .suffix_7 {
padding-right: 560px;
}
.container_12 .suffix_8 {
padding-right: 640px;
}
.container_12 .suffix_10 {
padding-right: 800px;
}
.container_12 .suffix_11 {
padding-right: 880px;
}
/* `Suffix Extra Space >> 16 Columns
----------------------------------------------------------------------------------------------------*/
.container_16 .suffix_1 {
padding-right: 60px;
}
.container_16 .suffix_2 {
padding-right: 120px;
}
.container_16 .suffix_3 {
padding-right: 180px;
}
.container_16 .suffix_5 {
padding-right: 300px;
}
.container_16 .suffix_6 {
padding-right: 360px;
}
.container_16 .suffix_7 {
padding-right: 420px;
}
.container_16 .suffix_9 {
padding-right: 540px;
}
.container_16 .suffix_10 {
padding-right: 600px;
}
.container_16 .suffix_11 {
padding-right: 660px;
}
.container_16 .suffix_13 {
padding-right: 780px;
}
.container_16 .suffix_14 {
padding-right: 840px;
}
.container_16 .suffix_15 {
padding-right: 900px;
}
/* `Push Space >> Global
----------------------------------------------------------------------------------------------------*/
.container_12 .push_3,
.container_16 .push_4 {
left: 240px;
}
.container_12 .push_6,
.container_16 .push_8 {
left: 480px;
}
.container_12 .push_9,
.container_16 .push_12 {
left: 720px;
}
/* `Push Space >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .push_1 {
left: 80px;
}
.container_12 .push_2 {
left: 160px;
}
.container_12 .push_4 {
left: 320px;
}
.container_12 .push_5 {
left: 400px;
}
.container_12 .push_7 {
left: 560px;
}
.container_12 .push_8 {
left: 640px;
}
.container_12 .push_10 {
left: 800px;
}
.container_12 .push_11 {
left: 880px;
}
/* `Push Space >> 16 Columns
----------------------------------------------------------------------------------------------------*/
.container_16 .push_1 {
left: 60px;
}
.container_16 .push_2 {
left: 120px;
}
.container_16 .push_3 {
left: 180px;
}
.container_16 .push_5 {
left: 300px;
}
.container_16 .push_6 {
left: 360px;
}
.container_16 .push_7 {
left: 420px;
}
.container_16 .push_9 {
left: 540px;
}
.container_16 .push_10 {
left: 600px;
}
.container_16 .push_11 {
left: 660px;
}
.container_16 .push_13 {
left: 780px;
}
.container_16 .push_14 {
left: 840px;
}
.container_16 .push_15 {
left: 900px;
}
/* `Pull Space >> Global
----------------------------------------------------------------------------------------------------*/
.container_12 .pull_3,
.container_16 .pull_4 {
left: -240px;
}
.container_12 .pull_6,
.container_16 .pull_8 {
left: -480px;
}
.container_12 .pull_9,
.container_16 .pull_12 {
left: -720px;
}
/* `Pull Space >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .pull_1 {
left: -80px;
}
.container_12 .pull_2 {
left: -160px;
}
.container_12 .pull_4 {
left: -320px;
}
.container_12 .pull_5 {
left: -400px;
}
.container_12 .pull_7 {
left: -560px;
}
.container_12 .pull_8 {
left: -640px;
}
.container_12 .pull_10 {
left: -800px;
}
.container_12 .pull_11 {
left: -880px;
}
/* `Pull Space >> 16 Columns
----------------------------------------------------------------------------------------------------*/
.container_16 .pull_1 {
left: -60px;
}
.container_16 .pull_2 {
left: -120px;
}
.container_16 .pull_3 {
left: -180px;
}
.container_16 .pull_5 {
left: -300px;
}
.container_16 .pull_6 {
left: -360px;
}
.container_16 .pull_7 {
left: -420px;
}
.container_16 .pull_9 {
left: -540px;
}
.container_16 .pull_10 {
left: -600px;
}
.container_16 .pull_11 {
left: -660px;
}
.container_16 .pull_13 {
left: -780px;
}
.container_16 .pull_14 {
left: -840px;
}
.container_16 .pull_15 {
left: -900px;
}
/* `Clear Floated Elements
----------------------------------------------------------------------------------------------------*/
/* http://sonspring.com/journal/clearing-floats */
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */
.clearfix:before,
.clearfix:after,
.container_12:before,
.container_12:after,
.container_16:before,
.container_16:after {
content: '.';
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.clearfix:after,
.container_12:after,
.container_16:after {
clear: both;
}
/*
The following zoom:1 rule is specifically for IE6 + IE7.
Move to separate stylesheet if invalid CSS is a problem.
*/
.clearfix,
.container_12,
.container_16 {
zoom: 1;
} | 0001-bee | trunk/cakephp2/app/webroot/css/960.css | CSS | gpl3 | 9,989 |
/**
*
* Generic CSS for CakePHP
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.webroot.css
* @since CakePHP(tm)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
* {
margin:0;
padding:0;
}
/** General Style Info **/
body {
color: #fff;
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
font-size:90%;
margin: 0;
}
a {
color: #003d4c;
text-decoration: underline;
font-weight: bold;
}
a:hover {
color: #367889;
text-decoration:none;
}
a img {
border:none;
}
h1, h2, h3, h4 {
font-weight: normal;
margin-bottom:0.5em;
}
h1 {
background:#fff;
color: #003d4c;
font-size: 100%;
}
h2 {
background:#fff;
color: #e32;
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 190%;
}
h3 {
color: #2c6877;
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 165%;
}
h4 {
color: #993;
font-weight: normal;
}
ul, li {
margin: 0 12px;
}
p {
margin: 0 0 1em 0;
}
/** Layout **/
#container {
text-align: left;
}
#header{
}
#header h1 {
line-height:20px;
background: #003d4c url('../img/cake.icon.png') no-repeat left;
color: #fff;
padding: 0px 30px;
}
#header h1 a {
color: #fff;
background: #003d4c;
font-weight: normal;
text-decoration: none;
}
#header h1 a:hover {
color: #fff;
background: #003d4c;
text-decoration: underline;
}
#content{
background: #fff;
clear: both;
color: #333;
overflow: auto;
}
#footer {
clear: both;
padding: 6px 10px;
text-align: right;
}
/** containers **/
div.form,
div.index,
div.view {
float:right;
width:76%;
border-left:1px solid #666;
padding:10px 2%;
}
div.actions {
float:left;
width:16%;
padding:10px 1.5%;
}
div.actions h3 {
padding-top:0;
color:#777;
}
/** Tables **/
table {
border-right:0;
clear: both;
color: #333;
margin-bottom: 10px;
width: 100%;
}
th {
border:0;
border-bottom:2px solid #555;
text-align: left;
padding:4px;
}
th a {
display: block;
padding: 2px 4px;
text-decoration: none;
}
th a.asc:after {
content: ' ⇣';
}
th a.desc:after {
content: ' ⇡';
}
table tr td {
padding: 6px;
text-align: left;
vertical-align: top;
border-bottom:1px solid #ddd;
}
table tr:nth-child(even) {
background: #f9f9f9;
}
td.actions {
text-align: center;
white-space: nowrap;
}
table td.actions a {
margin: 0px 6px;
padding:2px 5px;
}
/* SQL log */
.cake-sql-log {
background: #fff;
}
.cake-sql-log td {
padding: 4px 8px;
text-align: left;
font-family: Monaco, Consolas, "Courier New", monospaced;
}
.cake-sql-log caption {
color:#fff;
}
/** Paging **/
.paging {
background:#fff;
color: #ccc;
margin-top: 1em;
clear:both;
}
.paging .current,
.paging .disabled,
.paging a {
text-decoration: none;
padding: 5px 8px;
display: inline-block
}
.paging > span {
display: inline-block;
border: 1px solid #ccc;
border-left: 0;
}
.paging > span:hover {
background: #efefef;
}
.paging .prev {
border-left: 1px solid #ccc;
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.paging .next {
-moz-border-radius: 0 4px 4px 0;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.paging .disabled {
color: #ddd;
}
.paging .disabled:hover {
background: transparent;
}
.paging .current {
background: #efefef;
color: #c73e14;
}
/** Scaffold View **/
dl {
line-height: 2em;
margin: 0em 0em;
width: 60%;
}
dl dd:nth-child(4n+2),
dl dt:nth-child(4n+1) {
background: #f4f4f4;
}
dt {
font-weight: bold;
padding-left: 4px;
vertical-align: top;
width: 10em;
}
dd {
margin-left: 10em;
margin-top: -2em;
vertical-align: top;
}
/** Forms **/
form {
clear: both;
margin-right: 20px;
padding: 0;
width: 95%;
}
fieldset {
border: none;
margin-bottom: 1em;
padding: 16px 10px;
}
fieldset legend {
color: #e32;
font-size: 160%;
font-weight: bold;
}
fieldset fieldset {
margin-top: 0;
padding: 10px 0 0;
}
fieldset fieldset legend {
font-size: 120%;
font-weight: normal;
}
fieldset fieldset div {
clear: left;
margin: 0 20px;
}
form div {
clear: both;
margin-bottom: 1em;
padding: .5em;
vertical-align: text-top;
}
form .input {
color: #444;
}
form .required {
font-weight: bold;
}
form .required label:after {
color: #e32;
content: '*';
display:inline;
}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
}
label {
display: block;
font-size: 110%;
margin-bottom:3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
padding: 1%;
width:98%;
}
select {
clear: both;
font-size: 120%;
vertical-align: text-bottom;
}
select[multiple=multiple] {
width: 100%;
}
option {
font-size: 120%;
padding: 0 3px;
}
input[type=checkbox] {
clear: left;
float: left;
margin: 0px 6px 7px 2px;
width: auto;
}
div.checkbox label {
display: inline;
}
input[type=radio] {
float:left;
width:auto;
margin: 6px 0;
padding: 0;
line-height: 26px;
}
.radio label {
margin: 0 0 6px 20px;
line-height: 26px;
}
input[type=submit] {
display: inline;
font-size: 110%;
width: auto;
}
form .submit input[type=submit] {
background:#62af56;
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
border-color: #2d6324;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
padding: 8px 10px;
}
form .submit input[type=submit]:hover {
background: #5BA150;
}
/* Form errors */
form .error {
background: #FFDACC;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
font-weight: normal;
}
form .error-message {
-moz-border-radius: none;
-webkit-border-radius: none;
border-radius: none;
border: none;
background: none;
margin: 0;
padding-left: 4px;
padding-right: 0;
}
form .error,
form .error-message {
color: #9E2424;
-webkit-box-shadow: none;
-moz-box-shadow: none;
-ms-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
text-shadow: none;
}
/** Notices and Errors **/
.message {
clear: both;
color: #fff;
font-size: 140%;
font-weight: bold;
margin: 0 0 1em 0;
padding: 5px;
}
.success,
.message,
.cake-error,
.cake-debug,
.notice,
p.error,
.error-message {
background: #ffcc00;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
background-image: -webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#E6B800));
background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
background-image: linear-gradient(top, #ffcc00, #E6B800);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border: 1px solid rgba(0, 0, 0, 0.2);
margin-bottom: 18px;
padding: 7px 14px;
color: #404040;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.success,
.message,
.cake-error,
p.error,
.error-message {
clear: both;
color: #fff;
background: #c43c35;
border: 1px solid rgba(0, 0, 0, 0.5);
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.success {
clear: both;
color: #fff;
border: 1px solid rgba(0, 0, 0, 0.5);
background: #3B8230;
background-repeat: repeat-x;
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
background-image: -ms-linear-gradient(top, #76BF6B, #3B8230);
background-image: -o-linear-gradient(top, #76BF6B, #3B8230);
background-image: linear-gradient(top, #76BF6B, #3B8230);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
p.error {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 120%;
padding: 0.8em;
margin: 1em 0;
}
p.error em {
font-weight: normal;
line-height: 140%;
}
.notice {
color: #000;
display: block;
font-size: 120%;
padding: 0.8em;
margin: 1em 0;
}
.success {
color: #fff;
}
/** Actions **/
.actions ul {
margin: 0;
padding: 0;
}
.actions li {
margin:0 0 0.5em 0;
list-style-type: none;
white-space: nowrap;
padding: 0;
}
.actions ul li a {
font-weight: normal;
display: block;
clear: both;
}
/* Buttons and button links */
input[type=submit],
.actions ul li a,
.actions a {
font-weight:normal;
padding: 4px 8px;
background: #dcdcdc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
background-image: -webkit-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -moz-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -o-linear-gradient(top, #fefefe, #dcdcdc);
background-image: linear-gradient(top, #fefefe, #dcdcdc);
color:#333;
border:1px solid #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-decoration: none;
text-shadow: #fff 0px 1px 0px;
min-width: 0;
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-user-select: none;
user-select: none;
}
.actions ul li a:hover,
.actions a:hover {
background: #ededed;
border-color: #acacac;
text-decoration: none;
}
input[type=submit]:active,
.actions ul li a:active,
.actions a:active {
background: #eee;
background-image: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#eee));
background-image: -webkit-linear-gradient(top, #dfdfdf, #eee);
background-image: -moz-linear-gradient(top, #dfdfdf, #eee);
background-image: -ms-linear-gradient(top, #dfdfdf, #eee);
background-image: -o-linear-gradient(top, #dfdfdf, #eee);
background-image: linear-gradient(top, #dfdfdf, #eee);
text-shadow: #eee 0px 1px 0px;
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
border-color: #aaa;
text-decoration: none;
}
/** Related **/
.related {
clear: both;
display: block;
}
/** Debugging **/
pre {
color: #000;
background: #f0f0f0;
padding: 15px;
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.cake-debug-output {
padding: 0;
position: relative;
}
.cake-debug-output > span {
position: absolute;
top: 5px;
right: 5px;
background: rgba(255, 255, 255, 0.3);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 5px 6px;
color: #000;
display: block;
float: left;
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
.cake-debug,
.cake-error {
font-size: 16px;
line-height: 20px;
clear: both;
}
.cake-error > a {
text-shadow: none;
}
.cake-error {
white-space: normal;
}
.cake-stack-trace {
background: rgba(255, 255, 255, 0.7);
color: #333;
margin: 10px 0 5px 0;
padding: 10px 10px 0 10px;
font-size: 120%;
line-height: 140%;
overflow: auto;
position: relative;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.cake-stack-trace a {
text-shadow: none;
background: rgba(255, 255, 255, 0.7);
padding: 5px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 0px 4px 10px 2px;
font-family: sans-serif;
font-size: 14px;
line-height: 14px;
display: inline-block;
text-decoration: none;
-moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
}
.cake-code-dump pre {
position: relative;
overflow: auto;
}
.cake-context {
margin-bottom: 10px;
}
.cake-stack-trace pre {
color: #000;
background-color: #F0F0F0;
margin: 0px 0 10px 0;
padding: 1em;
overflow: auto;
text-shadow: none;
}
/* excerpt */
.cake-code-dump pre,
.cake-code-dump pre code {
clear: both;
font-size: 12px;
line-height: 15px;
margin: 4px 2px;
padding: 4px;
overflow: auto;
}
.cake-code-dump .code-highlight {
display: block;
background-color: rgba(255, 255, 0, 0.5);
}
.code-coverage-results div.code-line {
padding-left:5px;
display:block;
margin-left:10px;
}
.code-coverage-results div.uncovered span.content {
background:#ecc;
}
.code-coverage-results div.covered span.content {
background:#cec;
}
.code-coverage-results div.ignored span.content {
color:#aaa;
}
.code-coverage-results span.line-num {
color:#666;
display:block;
float:left;
width:20px;
text-align:right;
margin-right:5px;
}
.code-coverage-results span.line-num strong {
color:#666;
}
.code-coverage-results div.start {
border:1px solid #aaa;
border-width:1px 1px 0px 1px;
margin-top:30px;
padding-top:5px;
}
.code-coverage-results div.end {
border:1px solid #aaa;
border-width:0px 1px 1px 1px;
margin-bottom:30px;
padding-bottom:5px;
}
.code-coverage-results div.realstart {
margin-top:0px;
}
.code-coverage-results p.note {
color:#bbb;
padding:5px;
margin:5px 0 10px;
font-size:10px;
}
.code-coverage-results span.result-bad {
color: #a00;
}
.code-coverage-results span.result-ok {
color: #fa0;
}
.code-coverage-results span.result-good {
color: #0a0;
}
/** Elements **/
#url-rewriting-warning {
display:none;
}
| 0001-bee | trunk/cakephp2/app/webroot/css/cake.generic.css | CSS | gpl3 | 14,701 |
/* `XHTML, HTML4, HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
acronym,
address,
applet,
article,
aside,
audio,
b,
big,
blockquote,
body,
canvas,
caption,
center,
cite,
code,
dd,
del,
details,
dfn,
dialog,
div,
dl,
dt,
em,
embed,
fieldset,
figcaption,
figure,
font,
footer,
form,
h1,
h2,
h3,
h4,
h5,
h6,
header,
hgroup,
hr,
html,
i,
iframe,
img,
ins,
kbd,
label,
legend,
li,
mark,
menu,
meter,
nav,
object,
ol,
output,
p,
pre,
progress,
q,
rp,
rt,
ruby,
s,
samp,
section,
small,
span,
strike,
strong,
sub,
summary,
sup,
table,
tbody,
td,
tfoot,
th,
thead,
time,
tr,
tt,
u,
ul,
var,
video,
xmp {
border: 0;
margin: 0;
padding: 0;
font-size: 100%;
}
html,
body {
height: 100%;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
/*
Override the default (display: inline) for
browsers that do not recognize HTML5 tags.
IE8 (and lower) requires a shiv:
http://ejohn.org/blog/html5-shiv
*/
display: block;
}
b,
strong {
/*
Makes browsers agree.
IE + Opera = font-weight: bold.
Gecko + WebKit = font-weight: bolder.
*/
font-weight: bold;
}
img {
color: transparent;
font-size: 0;
vertical-align: middle;
/*
For IE.
http://css-tricks.com/ie-fix-bicubic-scaling-for-images
*/
-ms-interpolation-mode: bicubic;
}
li {
/*
For IE6 + IE7.
*/
display: list-item;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
th,
td,
caption {
font-weight: normal;
vertical-align: top;
text-align: left;
}
q {
quotes: none;
}
q:before,
q:after {
content: '';
content: none;
}
sub,
sup,
small {
font-size: 75%;
}
sub,
sup {
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
svg {
/*
For IE9.
*/
overflow: hidden;
} | 0001-bee | trunk/cakephp2/app/webroot/css/reset.css | CSS | gpl3 | 1,865 |
/*
960 Grid System ~ Text CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
*/
/* `Basic HTML
----------------------------------------------------------------------------------------------------*/
body {
font: 13px/1.5 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
}
pre,
code {
font-family: 'DejaVu Sans Mono', Monaco, Consolas, monospace;
}
hr {
border: 0 #ccc solid;
border-top-width: 1px;
clear: both;
height: 0;
}
/* `Headings
----------------------------------------------------------------------------------------------------*/
h1 {
font-size: 25px;
}
h2 {
font-size: 23px;
}
h3 {
font-size: 21px;
}
h4 {
font-size: 19px;
}
h5 {
font-size: 17px;
}
h6 {
font-size: 15px;
}
/* `Spacing
----------------------------------------------------------------------------------------------------*/
ol {
list-style: decimal;
}
ul {
list-style: disc;
}
li {
margin-left: 30px;
}
p,
dl,
hr,
h1,
h2,
h3,
h4,
h5,
h6,
ol,
ul,
pre,
table,
address,
fieldset,
figure {
margin-bottom: 20px;
} | 0001-bee | trunk/cakephp2/app/webroot/css/text.css | CSS | gpl3 | 1,064 |
/*
Document : main
Created on : Nov 23, 2011, 10:26:21 AM
Author : ulziibadrakh
Description:
Purpose of the stylesheet follows.
*/
html {
background: url('../img/back.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/** containers **/
div.form,
div.index,
div.view {
float:right;
width:76%;
border-left:1px solid #666;
padding:10px 2%;
}
div.actions {
float:left;
width:16%;
padding:10px 1.5%;
}
div.actions h3 {
padding-top:0;
color:#777;
}
/** Tables **/
table {
border-right:0;
clear: both;
color: #333;
margin-bottom: 10px;
width: 100%;
}
th {
border:0;
border-bottom:2px solid #555;
text-align: left;
padding:4px;
}
th a {
display: block;
padding: 2px 4px;
text-decoration: none;
}
th a.asc:after {
content: ' ⇣';
}
th a.desc:after {
content: ' ⇡';
}
table tr td {
padding: 6px;
text-align: left;
vertical-align: top;
border-bottom:1px solid #ddd;
}
table tr:nth-child(even) {
background: #f9f9f9;
}
td.actions {
text-align: center;
white-space: nowrap;
}
table td.actions a {
margin: 0px 6px;
padding:2px 5px;
}
/* SQL log */
.cake-sql-log {
background: #fff;
}
.cake-sql-log td {
padding: 4px 8px;
text-align: left;
font-family: Monaco, Consolas, "Courier New", monospaced;
}
.cake-sql-log caption {
color:#fff;
}
/** Paging **/
.paging {
background:#fff;
color: #ccc;
margin-top: 1em;
clear:both;
}
.paging .current,
.paging .disabled,
.paging a {
text-decoration: none;
padding: 5px 8px;
display: inline-block
}
.paging > span {
display: inline-block;
border: 1px solid #ccc;
border-left: 0;
}
.paging > span:hover {
background: #efefef;
}
.paging .prev {
border-left: 1px solid #ccc;
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.paging .next {
-moz-border-radius: 0 4px 4px 0;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.paging .disabled {
color: #ddd;
}
.paging .disabled:hover {
background: transparent;
}
.paging .current {
background: #efefef;
color: #c73e14;
}
/** Scaffold View **/
dl {
line-height: 2em;
margin: 0em 0em;
width: 60%;
}
dl dd:nth-child(4n+2),
dl dt:nth-child(4n+1) {
background: #f4f4f4;
}
dt {
font-weight: bold;
padding-left: 4px;
vertical-align: top;
width: 10em;
}
dd {
margin-left: 10em;
margin-top: -2em;
vertical-align: top;
}
/** Forms **/
form {
clear: both;
margin-right: 20px;
padding: 0;
width: 95%;
}
fieldset {
border: none;
margin-bottom: 1em;
padding: 16px 10px;
}
fieldset legend {
color: #e32;
font-size: 160%;
font-weight: bold;
}
fieldset fieldset {
margin-top: 0;
padding: 10px 0 0;
}
fieldset fieldset legend {
font-size: 120%;
font-weight: normal;
}
fieldset fieldset div {
clear: left;
margin: 0 20px;
}
form div {
clear: both;
margin-bottom: 1em;
padding: .5em;
vertical-align: text-top;
}
form .input {
color: #444;
}
form .required {
font-weight: bold;
}
form .required label:after {
color: #e32;
content: '*';
display:inline;
}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
}
label {
display: block;
font-size: 110%;
margin-bottom:3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
padding: 1%;
width:98%;
}
select {
clear: both;
font-size: 120%;
vertical-align: text-bottom;
}
select[multiple=multiple] {
width: 100%;
}
option {
font-size: 120%;
padding: 0 3px;
}
input[type=checkbox] {
clear: left;
float: left;
margin: 0px 6px 7px 2px;
width: auto;
}
div.checkbox label {
display: inline;
}
input[type=radio] {
float:left;
width:auto;
margin: 6px 0;
padding: 0;
line-height: 26px;
}
.radio label {
margin: 0 0 6px 20px;
line-height: 26px;
}
input[type=submit] {
display: inline;
font-size: 110%;
width: auto;
}
form .submit input[type=submit] {
background:#62af56;
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
border-color: #2d6324;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
padding: 8px 10px;
}
form .submit input[type=submit]:hover {
background: #5BA150;
}
/* Form errors */
form .error {
background: #FFDACC;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
font-weight: normal;
}
form .error-message {
-moz-border-radius: none;
-webkit-border-radius: none;
border-radius: none;
border: none;
background: none;
margin: 0;
padding-left: 4px;
padding-right: 0;
}
form .error,
form .error-message {
color: #9E2424;
-webkit-box-shadow: none;
-moz-box-shadow: none;
-ms-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
text-shadow: none;
}
/** Notices and Errors **/
.message {
clear: both;
color: #fff;
font-size: 140%;
font-weight: bold;
margin: 0 0 1em 0;
padding: 5px;
}
.success,
.message,
.cake-error,
.cake-debug,
.notice,
p.error,
.error-message {
background: #ffcc00;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
background-image: -webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#E6B800));
background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
background-image: linear-gradient(top, #ffcc00, #E6B800);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border: 1px solid rgba(0, 0, 0, 0.2);
margin-bottom: 18px;
padding: 7px 14px;
color: #404040;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.success,
.message,
.cake-error,
p.error,
.error-message {
clear: both;
color: #fff;
background: #c43c35;
border: 1px solid rgba(0, 0, 0, 0.5);
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.success {
clear: both;
color: #fff;
border: 1px solid rgba(0, 0, 0, 0.5);
background: #3B8230;
background-repeat: repeat-x;
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
background-image: -ms-linear-gradient(top, #76BF6B, #3B8230);
background-image: -o-linear-gradient(top, #76BF6B, #3B8230);
background-image: linear-gradient(top, #76BF6B, #3B8230);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
p.error {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 120%;
padding: 0.8em;
margin: 1em 0;
}
p.error em {
font-weight: normal;
line-height: 140%;
}
.notice {
color: #000;
display: block;
font-size: 120%;
padding: 0.8em;
margin: 1em 0;
}
.success {
color: #fff;
}
/** Actions **/
.actions ul {
margin: 0;
padding: 0;
}
.actions li {
margin:0 0 0.5em 0;
list-style-type: none;
white-space: nowrap;
padding: 0;
}
.actions ul li a {
font-weight: normal;
display: block;
clear: both;
}
/* Buttons and button links */
input[type=submit],
.actions ul li a,
.actions a {
font-weight:normal;
padding: 4px 8px;
background: #dcdcdc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
background-image: -webkit-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -moz-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -o-linear-gradient(top, #fefefe, #dcdcdc);
background-image: linear-gradient(top, #fefefe, #dcdcdc);
color:#333;
border:1px solid #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-decoration: none;
text-shadow: #fff 0px 1px 0px;
min-width: 0;
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-user-select: none;
user-select: none;
}
.actions ul li a:hover,
.actions a:hover {
background: #ededed;
border-color: #acacac;
text-decoration: none;
}
input[type=submit]:active,
.actions ul li a:active,
.actions a:active {
background: #eee;
background-image: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#eee));
background-image: -webkit-linear-gradient(top, #dfdfdf, #eee);
background-image: -moz-linear-gradient(top, #dfdfdf, #eee);
background-image: -ms-linear-gradient(top, #dfdfdf, #eee);
background-image: -o-linear-gradient(top, #dfdfdf, #eee);
background-image: linear-gradient(top, #dfdfdf, #eee);
text-shadow: #eee 0px 1px 0px;
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
border-color: #aaa;
text-decoration: none;
}
/** Related **/
.related {
clear: both;
display: block;
}
/** Debugging **/
pre {
color: #000;
background: #f0f0f0;
padding: 15px;
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.cake-debug-output {
padding: 0;
position: relative;
}
.cake-debug-output > span {
position: absolute;
top: 5px;
right: 5px;
background: rgba(255, 255, 255, 0.3);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 5px 6px;
color: #000;
display: block;
float: left;
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
.cake-debug,
.cake-error {
font-size: 16px;
line-height: 20px;
clear: both;
}
.cake-error > a {
text-shadow: none;
}
.cake-error {
white-space: normal;
}
.cake-stack-trace {
background: rgba(255, 255, 255, 0.7);
color: #333;
margin: 10px 0 5px 0;
padding: 10px 10px 0 10px;
font-size: 120%;
line-height: 140%;
overflow: auto;
position: relative;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.cake-stack-trace a {
text-shadow: none;
background: rgba(255, 255, 255, 0.7);
padding: 5px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 0px 4px 10px 2px;
font-family: sans-serif;
font-size: 14px;
line-height: 14px;
display: inline-block;
text-decoration: none;
-moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
}
.cake-code-dump pre {
position: relative;
overflow: auto;
}
.cake-context {
margin-bottom: 10px;
}
.cake-stack-trace pre {
color: #000;
background-color: #F0F0F0;
margin: 0px 0 10px 0;
padding: 1em;
overflow: auto;
text-shadow: none;
}
/* excerpt */
.cake-code-dump pre,
.cake-code-dump pre code {
clear: both;
font-size: 12px;
line-height: 15px;
margin: 4px 2px;
padding: 4px;
overflow: auto;
}
.cake-code-dump .code-highlight {
display: block;
background-color: rgba(255, 255, 0, 0.5);
}
.code-coverage-results div.code-line {
padding-left:5px;
display:block;
margin-left:10px;
}
.code-coverage-results div.uncovered span.content {
background:#ecc;
}
.code-coverage-results div.covered span.content {
background:#cec;
}
.code-coverage-results div.ignored span.content {
color:#aaa;
}
.code-coverage-results span.line-num {
color:#666;
display:block;
float:left;
width:20px;
text-align:right;
margin-right:5px;
}
.code-coverage-results span.line-num strong {
color:#666;
}
.code-coverage-results div.start {
border:1px solid #aaa;
border-width:1px 1px 0px 1px;
margin-top:30px;
padding-top:5px;
}
.code-coverage-results div.end {
border:1px solid #aaa;
border-width:0px 1px 1px 1px;
margin-bottom:30px;
padding-bottom:5px;
}
.code-coverage-results div.realstart {
margin-top:0px;
}
.code-coverage-results p.note {
color:#bbb;
padding:5px;
margin:5px 0 10px;
font-size:10px;
}
.code-coverage-results span.result-bad {
color: #a00;
}
.code-coverage-results span.result-ok {
color: #fa0;
}
.code-coverage-results span.result-good {
color: #0a0;
}
/** Elements **/
#url-rewriting-warning {
display:none;
}
.content {
background: #ffffff;
opacity:0.8;
}
| 0001-bee | trunk/cakephp2/app/webroot/css/main.css | CSS | gpl3 | 13,239 |
<?php
App::uses('AppController', 'Controller');
/**
* PhotoGroups Controller
*
* @property PhotoGroup $PhotoGroup
*/
class PhotoGroupsController extends AppController {
/**
* index method
*
* @return void
*/
public $helpers = array('Js');
public $components = array('RequestHandler');
public function index() {
if ($this->request->is('post')) {
$this->PhotoGroup->create();
if ($this->PhotoGroup->save($this->request->data)) {
if($this->RequestHandler->isAjax()){
$this->PhotoGroup->recursive = 0;
$this->set('photoGroups', $this->paginate());
$this->render('indax','ajax');
$this->Session->setFlash(__('The photo group has been saved'));
}
} else {
$this->Session->setFlash(__('The photo group could not be saved. Please, try again.'));
}
}
$this->PhotoGroup->recursive = 0;
$this->set('photoGroups', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->PhotoGroup->id = $id;
if (!$this->PhotoGroup->exists()) {
throw new NotFoundException(__('Invalid photo group'));
}
$this->set('photoGroup', $this->PhotoGroup->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->PhotoGroup->create();
if ($this->PhotoGroup->save($this->request->data)) {
$this->Session->setFlash(__('The photo group has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The photo group could not be saved. Please, try again.'));
}
}
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->PhotoGroup->id = $id;
if (!$this->PhotoGroup->exists()) {
throw new NotFoundException(__('Invalid photo group'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->PhotoGroup->save($this->request->data)) {
$this->Session->setFlash(__('The photo group has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The photo group could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->PhotoGroup->read(null, $id);
}
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->PhotoGroup->id = $id;
if (!$this->PhotoGroup->exists()) {
throw new NotFoundException(__('Invalid photo group'));
}
if ($this->PhotoGroup->delete()) {
$this->Session->setFlash(__('Photo group deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Photo group was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/PhotoGroupsController.php | PHP | gpl3 | 3,151 |
<?php
App::uses('AppController', 'Controller');
/**
* Languages Controller
*
* @property Language $Language
*/
class LanguagesController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Language->recursive = 0;
$this->set('languages', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Language->id = $id;
if (!$this->Language->exists()) {
throw new NotFoundException(__('Invalid language'));
}
$this->set('language', $this->Language->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Language->create();
if ($this->Language->save($this->request->data)) {
$this->Session->setFlash(__('The language has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The language could not be saved. Please, try again.'));
}
}
$sources = $this->Language->Source->find('list');
$destinations = $this->Language->Destination->find('list');
$users = $this->Language->User->find('list');
$this->set(compact('sources', 'destinations', 'users'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Language->id = $id;
if (!$this->Language->exists()) {
throw new NotFoundException(__('Invalid language'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Language->save($this->request->data)) {
$this->Session->setFlash(__('The language has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The language could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Language->read(null, $id);
}
$sources = $this->Language->Source->find('list');
$destinations = $this->Language->Destination->find('list');
$users = $this->Language->User->find('list');
$this->set(compact('sources', 'destinations', 'users'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Language->id = $id;
if (!$this->Language->exists()) {
throw new NotFoundException(__('Invalid language'));
}
if ($this->Language->delete()) {
$this->Session->setFlash(__('Language deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Language was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/LanguagesController.php | PHP | gpl3 | 2,772 |
<?php
App::uses('AppController', 'Controller');
/**
* MessagesUsers Controller
*
* @property MessagesUser $MessagesUser
*/
class MessagesUsersController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->MessagesUser->recursive = 0;
$this->set('messagesUsers', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->MessagesUser->id = $id;
if (!$this->MessagesUser->exists()) {
throw new NotFoundException(__('Invalid messages user'));
}
$this->set('messagesUser', $this->MessagesUser->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->MessagesUser->create();
if ($this->MessagesUser->save($this->request->data)) {
$this->Session->setFlash(__('The messages user has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The messages user could not be saved. Please, try again.'));
}
}
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->MessagesUser->id = $id;
if (!$this->MessagesUser->exists()) {
throw new NotFoundException(__('Invalid messages user'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->MessagesUser->save($this->request->data)) {
$this->Session->setFlash(__('The messages user has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The messages user could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->MessagesUser->read(null, $id);
}
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->MessagesUser->id = $id;
if (!$this->MessagesUser->exists()) {
throw new NotFoundException(__('Invalid messages user'));
}
if ($this->MessagesUser->delete()) {
$this->Session->setFlash(__('Messages user deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Messages user was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/MessagesUsersController.php | PHP | gpl3 | 2,443 |
<?php
App::uses('AppController', 'Controller');
/**
* Comments Controller
*
* @property Comment $Comment
*/
class CommentsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Comment->recursive = 0;
$this->set('comments', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Comment->id = $id;
if (!$this->Comment->exists()) {
throw new NotFoundException(__('Invalid comment'));
}
$this->set('comment', $this->Comment->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Comment->create();
if ($this->Comment->save($this->request->data)) {
$this->Session->setFlash(__('The comment has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The comment could not be saved. Please, try again.'));
}
}
$users = $this->Comment->User->find('list');
$posts = $this->Comment->Post->find('list');
$this->set(compact('users', 'posts'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Comment->id = $id;
if (!$this->Comment->exists()) {
throw new NotFoundException(__('Invalid comment'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Comment->save($this->request->data)) {
$this->Session->setFlash(__('The comment has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The comment could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Comment->read(null, $id);
}
$users = $this->Comment->User->find('list');
$posts = $this->Comment->Post->find('list');
$this->set(compact('users', 'posts'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Comment->id = $id;
if (!$this->Comment->exists()) {
throw new NotFoundException(__('Invalid comment'));
}
if ($this->Comment->delete()) {
$this->Session->setFlash(__('Comment deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Comment was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/CommentsController.php | PHP | gpl3 | 2,570 |
<?php
App::uses('AppController', 'Controller');
/**
* Educations Controller
*
* @property Education $Education
*/
class EducationsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Education->recursive = 0;
$this->set('educations', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Education->id = $id;
if (!$this->Education->exists()) {
throw new NotFoundException(__('Invalid education'));
}
$this->set('education', $this->Education->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Education->create();
if ($this->Education->save($this->request->data)) {
$this->Session->setFlash(__('The education has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The education could not be saved. Please, try again.'));
}
}
$users = $this->Education->User->find('list');
$eduTypes = $this->Education->EduType->find('list');
$this->set(compact('users', 'eduTypes'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Education->id = $id;
if (!$this->Education->exists()) {
throw new NotFoundException(__('Invalid education'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Education->save($this->request->data)) {
$this->Session->setFlash(__('The education has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The education could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Education->read(null, $id);
}
$users = $this->Education->User->find('list');
$eduTypes = $this->Education->EduType->find('list');
$this->set(compact('users', 'eduTypes'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Education->id = $id;
if (!$this->Education->exists()) {
throw new NotFoundException(__('Invalid education'));
}
if ($this->Education->delete()) {
$this->Session->setFlash(__('Education deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Education was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/EducationsController.php | PHP | gpl3 | 2,652 |
<?php
/**
* Static content controller.
*
* This file will render views from views/pages/
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Controller
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Static content controller
*
* Override this controller by placing a copy in controllers directory of an application
*
* @package app.Controller
*/
class PagesController extends AppController {
/**
* Controller name
*
* @var string
*/
public $name = 'Pages';
/**
* Default helper
*
* @var array
*/
public $helpers = array('Html');
/**
* This controller does not use a model
*
* @var array
*/
public $uses = array();
/**
* Displays a view
*
* @param mixed What page to display
*/
public function display() {
$path = func_get_args();
$count = count($path);
if (!$count) {
$this->redirect('/');
}
$page = $subpage = $title_for_layout = null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 1]);
}
$this->set(compact('page', 'subpage', 'title_for_layout'));
$this->render(implode('/', $path));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/PagesController.php | PHP | gpl3 | 1,685 |
<?php
// app/Controller/AppController.php
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'photos', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home')
)
);
function beforeFilter() {
$this->Auth->allow('index', 'view');
}
} | 0001-bee | trunk/cakephp2/app/Controller/AppController.php | PHP | gpl3 | 441 |
<?php
App::uses('AppController', 'Controller');
/**
* Sources Controller
*
* @property Source $Source
*/
class SourcesController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Source->recursive = 0;
$this->set('sources', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Source->id = $id;
if (!$this->Source->exists()) {
throw new NotFoundException(__('Invalid source'));
}
$this->set('source', $this->Source->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Source->create();
if ($this->Source->save($this->request->data)) {
$this->Session->setFlash(__('The source has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The source could not be saved. Please, try again.'));
}
}
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Source->id = $id;
if (!$this->Source->exists()) {
throw new NotFoundException(__('Invalid source'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Source->save($this->request->data)) {
$this->Session->setFlash(__('The source has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The source could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Source->read(null, $id);
}
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Source->id = $id;
if (!$this->Source->exists()) {
throw new NotFoundException(__('Invalid source'));
}
if ($this->Source->delete()) {
$this->Session->setFlash(__('Source deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Source was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/SourcesController.php | PHP | gpl3 | 2,266 |
<?php
App::uses('AppController', 'Controller');
/**
* Photos Controller
*
* @property Photo $Photo
*/
class PhotosController extends AppController {
/**
* index method
*
* @return void
*/
public $helpers = array('Js');
public $components = array('RequestHandler');
public function index() {
if ($this->request->is('post')) {
$this->Photo->create();
if ($this->Photo->save($this->request->data)) {
if ($this->RequestHandler->isAjax()) {
$this->Photo->recursive = 0;
$photoGroups = $this->Photo->PhotoGroup->find('list');
$this->set(compact('photoGroups'));
$this->set('photos', $this->paginate());
$this->render('ijax', 'ajax');
$this->Session->setFlash(__('The photo group has been saved'));
}
$this->Session->setFlash(__('The photo has been saved'));
} else {
$this->Session->setFlash(__('The photo could not be saved. Please, try again.'));
}
}
$photoGroups = $this->Photo->PhotoGroup->find('list');
$this->set(compact('photoGroups'));
$this->Photo->recursive = 0;
$this->set('photos', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Photo->id = $id;
if (!$this->Photo->exists()) {
throw new NotFoundException(__('Invalid photo'));
}
$this->set('photo', $this->Photo->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Photo->create();
if ($this->Photo->save($this->request->data)) {
$this->Session->setFlash(__('The photo has been saved'));
} else {
$this->Session->setFlash(__('The photo could not be saved. Please, try again.'));
}
}
$photoGroups = $this->Photo->PhotoGroup->find('list');
$this->set(compact('photoGroups'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Photo->id = $id;
if (!$this->Photo->exists()) {
throw new NotFoundException(__('Invalid photo'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Photo->save($this->request->data)) {
$this->Session->setFlash(__('The photo has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The photo could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Photo->read(null, $id);
}
$photoGroups = $this->Photo->PhotoGroup->find('list');
$this->set(compact('photoGroups'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Photo->id = $id;
if (!$this->Photo->exists()) {
throw new NotFoundException(__('Invalid photo'));
}
$Photo = $this->Photo->find('first', array('conditions' => array('Photo.id' => $id)));
if (unlink(IMAGES . DS . $Photo['Photo']['name'])) {
if ($this->Photo->delete()) {
$this->Session->setFlash(__('Photo deleted'));
$this->redirect(array('action' => 'index'));
}
}
$this->Session->setFlash(__('Photo was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/PhotosController.php | PHP | gpl3 | 4,089 |
<?php
App::uses('AppController', 'Controller');
/**
* Users Controller
*
* @property User $User
*/
class UsersController extends AppController {
/**
* index method
*
* @return void
*/
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('add'); // Letting users register themselves
}
public function login() {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
public function logout() {
$this->redirect($this->Auth->logout());
}
public function index() {
$this->User->recursive = 0;
$this->set('users', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->User->id = $id;
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid user'));
}
$this->set('user', $this->User->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->User->create();
if ($this->User->save($this->request->data)) {
$this->Session->setFlash(__('The user has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
}
}
$messages = $this->User->Message->find('list');
$friends = $this->User->Friend->find('list');
$languages = $this->User->Language->find('list');
$this->set(compact('messages', 'friends', 'languages'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->User->id = $id;
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid user'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->User->save($this->request->data)) {
$this->Session->setFlash(__('The user has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->User->read(null, $id);
}
$messages = $this->User->Message->find('list');
$friends = $this->User->Friend->find('list');
$languages = $this->User->Language->find('list');
$this->set(compact('messages', 'friends', 'languages'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->User->id = $id;
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid user'));
}
if ($this->User->delete()) {
$this->Session->setFlash(__('User deleted'));
$this->redirect(array('action' => 'index'));
}
$this->Session->setFlash(__('User was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/UsersController.php | PHP | gpl3 | 3,658 |
<?php
App::uses('AppController', 'Controller');
/**
* UsersFriends Controller
*
* @property UsersFriend $UsersFriend
*/
class UsersFriendsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->UsersFriend->recursive = 0;
$this->set('usersFriends', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->UsersFriend->id = $id;
if (!$this->UsersFriend->exists()) {
throw new NotFoundException(__('Invalid users friend'));
}
$this->set('usersFriend', $this->UsersFriend->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->UsersFriend->create();
if ($this->UsersFriend->save($this->request->data)) {
$this->Session->setFlash(__('The users friend has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The users friend could not be saved. Please, try again.'));
}
}
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->UsersFriend->id = $id;
if (!$this->UsersFriend->exists()) {
throw new NotFoundException(__('Invalid users friend'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->UsersFriend->save($this->request->data)) {
$this->Session->setFlash(__('The users friend has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The users friend could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->UsersFriend->read(null, $id);
}
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->UsersFriend->id = $id;
if (!$this->UsersFriend->exists()) {
throw new NotFoundException(__('Invalid users friend'));
}
if ($this->UsersFriend->delete()) {
$this->Session->setFlash(__('Users friend deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Users friend was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/UsersFriendsController.php | PHP | gpl3 | 2,415 |
<?php
App::uses('AppController', 'Controller');
/**
* Profiles Controller
*
* @property Profile $Profile
*/
class ProfilesController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Profile->recursive = 0;
$this->set('profiles', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Profile->id = $id;
if (!$this->Profile->exists()) {
throw new NotFoundException(__('Invalid profile'));
}
$this->set('profile', $this->Profile->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Profile->create();
if ($this->Profile->save($this->request->data)) {
$this->Session->setFlash(__('The profile has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The profile could not be saved. Please, try again.'));
}
}
$users = $this->Profile->User->find('list');
$this->set(compact('users'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Profile->id = $id;
if (!$this->Profile->exists()) {
throw new NotFoundException(__('Invalid profile'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Profile->save($this->request->data)) {
$this->Session->setFlash(__('The profile has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The profile could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Profile->read(null, $id);
}
$users = $this->Profile->User->find('list');
$this->set(compact('users'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Profile->id = $id;
if (!$this->Profile->exists()) {
throw new NotFoundException(__('Invalid profile'));
}
if ($this->Profile->delete()) {
$this->Session->setFlash(__('Profile deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Profile was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/ProfilesController.php | PHP | gpl3 | 2,456 |
<?php
App::uses('AppController', 'Controller');
/**
* Posts Controller
*
* @property Post $Post
*/
class PostsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Post->recursive = 0;
$this->set('posts', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Post->id = $id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
$this->set('post', $this->Post->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Post->create();
if ($this->Post->save($this->request->data)) {
$this->Session->setFlash(__('The post has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The post could not be saved. Please, try again.'));
}
}
$users = $this->Post->User->find('list');
$this->set(compact('users'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Post->id = $id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Post->save($this->request->data)) {
$this->Session->setFlash(__('The post has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The post could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Post->read(null, $id);
}
$users = $this->Post->User->find('list');
$this->set(compact('users'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Post->id = $id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
if ($this->Post->delete()) {
$this->Session->setFlash(__('Post deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Post was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/PostsController.php | PHP | gpl3 | 2,366 |
<?php
App::uses('AppController', 'Controller');
/**
* EduTypes Controller
*
* @property EduType $EduType
*/
class EduTypesController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->EduType->recursive = 0;
$this->set('eduTypes', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->EduType->id = $id;
if (!$this->EduType->exists()) {
throw new NotFoundException(__('Invalid edu type'));
}
$this->set('eduType', $this->EduType->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->EduType->create();
if ($this->EduType->save($this->request->data)) {
$this->Session->setFlash(__('The edu type has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The edu type could not be saved. Please, try again.'));
}
}
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->EduType->id = $id;
if (!$this->EduType->exists()) {
throw new NotFoundException(__('Invalid edu type'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->EduType->save($this->request->data)) {
$this->Session->setFlash(__('The edu type has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The edu type could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->EduType->read(null, $id);
}
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->EduType->id = $id;
if (!$this->EduType->exists()) {
throw new NotFoundException(__('Invalid edu type'));
}
if ($this->EduType->delete()) {
$this->Session->setFlash(__('Edu type deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Edu type was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/EduTypesController.php | PHP | gpl3 | 2,303 |
<?php
App::uses('AppController', 'Controller');
/**
* Messages Controller
*
* @property Message $Message
*/
class MessagesController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Message->recursive = 0;
$this->set('messages', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Message->id = $id;
if (!$this->Message->exists()) {
throw new NotFoundException(__('Invalid message'));
}
$this->set('message', $this->Message->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Message->create();
if ($this->Message->save($this->request->data)) {
$this->Session->setFlash(__('The message has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The message could not be saved. Please, try again.'));
}
}
$users = $this->Message->User->find('list');
$users = $this->Message->User->find('list');
$this->set(compact('users', 'users'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Message->id = $id;
if (!$this->Message->exists()) {
throw new NotFoundException(__('Invalid message'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Message->save($this->request->data)) {
$this->Session->setFlash(__('The message has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The message could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Message->read(null, $id);
}
$users = $this->Message->User->find('list');
$users = $this->Message->User->find('list');
$this->set(compact('users', 'users'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Message->id = $id;
if (!$this->Message->exists()) {
throw new NotFoundException(__('Invalid message'));
}
if ($this->Message->delete()) {
$this->Session->setFlash(__('Message deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Message was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/MessagesController.php | PHP | gpl3 | 2,570 |
<?php
App::uses('AppController', 'Controller');
/**
* Jobs Controller
*
* @property Job $Job
*/
class JobsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Job->recursive = 0;
$this->set('jobs', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Job->id = $id;
if (!$this->Job->exists()) {
throw new NotFoundException(__('Invalid job'));
}
$this->set('job', $this->Job->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Job->create();
if ($this->Job->save($this->request->data)) {
$this->Session->setFlash(__('The job has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The job could not be saved. Please, try again.'));
}
}
$users = $this->Job->User->find('list');
$this->set(compact('users'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Job->id = $id;
if (!$this->Job->exists()) {
throw new NotFoundException(__('Invalid job'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Job->save($this->request->data)) {
$this->Session->setFlash(__('The job has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The job could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Job->read(null, $id);
}
$users = $this->Job->User->find('list');
$this->set(compact('users'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Job->id = $id;
if (!$this->Job->exists()) {
throw new NotFoundException(__('Invalid job'));
}
if ($this->Job->delete()) {
$this->Session->setFlash(__('Job deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Job was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/JobsController.php | PHP | gpl3 | 2,336 |
<?php
App::uses('AppController', 'Controller');
/**
* Groups Controller
*
* @property Group $Group
*/
class GroupsController extends AppController {
/**
* index method
*
* @return void
*/
public function index() {
$this->Group->recursive = 0;
$this->set('groups', $this->paginate());
}
/**
* view method
*
* @param string $id
* @return void
*/
public function view($id = null) {
$this->Group->id = $id;
if (!$this->Group->exists()) {
throw new NotFoundException(__('Invalid group'));
}
$this->set('group', $this->Group->read(null, $id));
}
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Group->create();
if ($this->Group->save($this->request->data)) {
$this->Session->setFlash(__('The group has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The group could not be saved. Please, try again.'));
}
}
$photos = $this->Group->Photo->find('list');
$this->set(compact('photos'));
}
/**
* edit method
*
* @param string $id
* @return void
*/
public function edit($id = null) {
$this->Group->id = $id;
if (!$this->Group->exists()) {
throw new NotFoundException(__('Invalid group'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Group->save($this->request->data)) {
$this->Session->setFlash(__('The group has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The group could not be saved. Please, try again.'));
}
} else {
$this->request->data = $this->Group->read(null, $id);
}
$photos = $this->Group->Photo->find('list');
$this->set(compact('photos'));
}
/**
* delete method
*
* @param string $id
* @return void
*/
public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Group->id = $id;
if (!$this->Group->exists()) {
throw new NotFoundException(__('Invalid group'));
}
if ($this->Group->delete()) {
$this->Session->setFlash(__('Group deleted'));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Group was not deleted'));
$this->redirect(array('action' => 'index'));
}
}
| 0001-bee | trunk/cakephp2/app/Controller/GroupsController.php | PHP | gpl3 | 2,402 |