Skip to content

Commit

Permalink
migrating to cake2
Browse files Browse the repository at this point in the history
  • Loading branch information
yandod committed May 22, 2012
1 parent ab02f07 commit 297de8d
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 14 deletions.
8 changes: 8 additions & 0 deletions Config/routes.php
@@ -0,0 +1,8 @@
<?php
Router::connect(
'/projects/:project_id/nyanchart/:action',
array(
'plugin' => 'CcNyancat',
'controller' => 'Chart'
)
);
File renamed without changes.
Expand Up @@ -3,7 +3,7 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class CcNyancatChartController extends CcNyancatAppController {
class ChartController extends CcNyancatAppController {

/**
* No models required
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions views/cc_nyancat_chart/index.ctp → View/Chart/index.ctp
Expand Up @@ -10,16 +10,16 @@ $reports_by_id = Set::combine($reports,'{n}.assigned_to_id','{n}');
</tr>
</thead>
<tbody>
<?php foreach ($mainProject['User'] as $val):?>
<tr class="<?php echo $candy->cycle('even','odd')?>">
<td align="center"><?php echo $candy->format_username($val)?></td>
<?php foreach ($main_project['User'] as $val):?>
<tr class="<?php echo $this->Candy->cycle('even','odd')?>">
<td align="center"><?php echo $this->Candy->format_username($val)?></td>
<td align="center"><?php
$num = isset($reports_by_id[$val['id']]['total']) ? $reports_by_id[$val['id']]['total'] - $reports_by_id[$val['id']]['closed'] : 0;
echo $num;
?></td>
<td align="left"><?php
for ($i = 0; $i < $num; $i++) {
echo $html->image('/cc_nyancat/img/poptartFINALTINY.gif');
echo $this->Html->image('/cc_nyancat/img/poptartFINALTINY.gif');
}
?></td>
</tr>
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions View/Nyan/index.ctp
@@ -0,0 +1,3 @@
<?php
echo $this->Html->image('/cc_nyancat/img/poptart1red1.gif');
?>
15 changes: 9 additions & 6 deletions init.php
Expand Up @@ -24,8 +24,8 @@
$menuContainer->addProjectMenu(
'nyancat',
array(
'plugin' => 'cc_nyancat',
'controller' => 'cc_nyancat_chart',
'plugin' => 'CcNyancat',
'controller' => 'Chart',
'action' => 'index',
'class' => '',
'caption' => 'Nyan Down Chart',
Expand All @@ -34,21 +34,24 @@
)
);
// make sure put new route setting which includes project_id
App::import('Core','Router');
Router::connect('/projects/:project_id/nyanchart/:action', array('plugin' => 'cc_nyancat','controller' => 'cc_nyancat_chart'));
CakePlugin::loadAll(
array(
'CcNyancat' => array('routes' => true)
)
);

/**
* Injecting specific template before or after a templete.
*/
$hookContainer = ClassRegistry::getObject('HookContainer');
$hookContainer->registerElementHook(
'issues/relations', // target element name.
'../../plugins/cc_nyancat/views/elements/nyancat', // additional template you want to inject.
'../../Plugin/CcNyancat/View/Element/nyancat', // additional template you want to inject.
false // it should be true when you want to inject before the target template.
);

/**
* register plugin information into container
*/
$pluginContainer = ClassRegistry::getObject('PluginContainer');
$pluginContainer->installed('cc_nyancat','0.2');
$pluginContainer->installed('cc_nyancat','0.3');
3 changes: 0 additions & 3 deletions views/nyan/index.ctp

This file was deleted.

File renamed without changes
File renamed without changes

0 comments on commit 297de8d

Please sign in to comment.