Skip to content

Commit

Permalink
module management now pretty much sorted out, time to do the module l…
Browse files Browse the repository at this point in the history
…oader
  • Loading branch information
dogmatic69 committed Jan 18, 2010
1 parent 953e1c6 commit 63a513b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 27 deletions.
8 changes: 6 additions & 2 deletions infinitas/management/controllers/modules_controller.php
Expand Up @@ -26,8 +26,7 @@ function admin_add() {

$positions = $this->Module->Position->find('list');
$groups = $this->Module->Group->find('list');

$routes = ClassRegistry::init('Core.Route')->find('list');
$routes = array(0 => __('All Pages', true)) + $this->Module->Route->find('list');
$this->set(compact('positions', 'groups', 'routes'));
}

Expand All @@ -49,6 +48,11 @@ function admin_edit($id = null) {
if ($id && empty($this->data)) {
$this->data = $this->Module->read(null, $id);
}

$positions = $this->Module->Position->find('list');
$groups = $this->Module->Group->find('list');
$routes = array(0 => __('All Pages', true)) + $this->Module->Route->find('list');
$this->set(compact('positions', 'groups', 'routes'));
}
}
?>
6 changes: 3 additions & 3 deletions infinitas/management/models/module.php
Expand Up @@ -28,9 +28,9 @@ class Module extends ManagementAppModel{
);

var $hasAndBelongsToMany = array(
'ModulesRoute' => array(
'className' => 'Core.ModulesRoute',
'joinTable' => 'modules_routes',
'Route' => array(
'className' => 'Core.Route',
'joinTable' => 'core_modules_routes',
'foreignKey' => 'module_id',
'associationForeignKey' => 'route_id',
'unique' => true
Expand Down
6 changes: 3 additions & 3 deletions infinitas/management/views/modules/admin_add.ctp
@@ -1,8 +1,8 @@
<?php
/**
* Management Config admin edit post.
* Management Modules admin edit post.
*
* this page is for admin to manage the setup of the site
* this page is for admin to manage the modules on the site
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
Expand Down Expand Up @@ -40,7 +40,7 @@
</div>
<div style="width:50%; float:left;">
<?php
echo $this->Form->input('ModulesRoute.Route', array('multiple' => true));
echo $this->Form->input('Route', array('selected' => 0));
?>
</div>
<div class="clr">&nbsp;</div>
Expand Down
46 changes: 32 additions & 14 deletions infinitas/management/views/modules/admin_edit.ctp
@@ -1,8 +1,8 @@
<?php
/**
* Management Config admin edit post.
* Management Modules admin edit post.
*
* this page is for admin to manage the setup of the site
* this page is for admin to manage the modules on the site
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
Expand All @@ -18,15 +18,33 @@
*/

echo $this->Core->adminOtherHead( $this );
echo $this->Form->create( 'Theme' );
echo $this->Form->input( 'id' );
echo $this->Form->input( 'name' );
echo $this->Form->input( 'author' );
echo $this->Form->input( 'url' );
echo $this->Form->input( 'update_url' );
echo $this->Form->input( 'licence' );
echo $this->Form->input( 'active' );
echo $this->Form->input( 'core' );
echo $this->Core->wysiwyg( 'Theme.description' );
echo $this->Form->end( 'Save Theme' );
?>
echo $this->Form->create( 'Module' );
?>
<div style="width:50%; float:left;">
<?php
echo $this->Form->input( 'id' );
echo $this->Form->input( 'name' );
echo $this->Form->input( 'module' );
echo $this->Form->input( 'position_id' );
echo $this->Form->input( 'group_id' );
echo $this->Form->input( 'active' );
echo $this->Form->input( 'show_heading' );
echo $this->Form->input( 'core' );
echo $this->Form->input( 'author' );
echo $this->Form->input( 'url' );
echo $this->Form->input( 'update_url' );
echo $this->Form->input( 'licence' );

echo $this->Form->input( 'content', array('class' => 'title') );
echo $this->Form->input( 'config', array('class' => 'title') );
?>
</div>
<div style="width:50%; float:left;">
<?php
echo $this->Form->input('Route');
?>
</div>
<div class="clr">&nbsp;</div>
<?php
echo $this->Form->end( 'Save Module' );
?>
10 changes: 5 additions & 5 deletions infinitas/management/views/modules/admin_index.ctp
Expand Up @@ -42,9 +42,9 @@
'style' => 'width:25px;'
),
$this->Paginator->sort( 'name' ),
$this->Paginator->sort( 'Position', 'Position.Name' ),
$this->Paginator->sort( 'author' ),
$this->Paginator->sort( 'licence' ),
$this->Paginator->sort( 'Position', 'Position.Name' ) => array(
$this->Paginator->sort( 'licence' ) => array(
'style' => 'width:75px;'
),
$this->Paginator->sort( 'Group', 'Group.Name' ) => array(
Expand Down Expand Up @@ -98,13 +98,13 @@
<?php echo $this->Status->locked($module['Module']['locked']); ?>&nbsp;
</td>
<td>
<?php echo $this->Core->ordering($module['Module']['order']); ?>&nbsp;
<?php echo $module['Module']['ordering'], ' ', $this->Core->ordering($module['Module']['ordering']); ?>&nbsp;
</td>
<td>
<?php echo $this->Status->status( $theme['Theme']['core'] ); ?>&nbsp;
<?php echo $this->Status->status($module['Module']['core']); ?>&nbsp;
</td>
<td>
<?php echo $this->Status->status( $theme['Theme']['active'] ); ?>&nbsp;
<?php echo $this->Status->status($module['Module']['active']); ?>&nbsp;
</td>
</tr>
<?php
Expand Down

0 comments on commit 63a513b

Please sign in to comment.