Skip to content

Commit

Permalink
getting the blog working
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Feb 9, 2010
1 parent 31b519e commit fb1238f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions extensions/libs/models/behaviors/rateable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RateableBehavior extends ModelBehavior {
* @var array
*/
var $defaults = array(
'plugin' => 'Core', // name of Rating model
'plugin' => 'Management', // name of Rating model
'class' => 'Rating', // name of Rating model
'foreign_key' => 'foreign_id', // foreign key of Rating model
'counter_cache' => true,
Expand Down Expand Up @@ -39,7 +39,7 @@ function setup(&$model, $settings = array()) {
$default['requre_auth'] = Configure::read('Rating.require_auth');

//$ratingClass = isset( $default['plugin'] ) ? $default['plugin'].'.'.$default['class'] : $default['class'];
$ratingClass = 'CoreRating';
$ratingClass = 'Management.Rating';

if (!isset($this->__settings[$model->alias])) {
$this->__settings[$model->alias] = $default;
Expand Down
7 changes: 4 additions & 3 deletions extensions/libs/views/helpers/infinitas.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function status( $status = null )
/**
* Toogle button
*
* Uses Status::status to get the image and then creates a link based on
* Uses Infinitas::status to get the image and then creates a link based on
* the $method param
*/
function toggle( $status = null, $id = null, $url = array( 'action' => 'toggle' ) )
Expand Down Expand Up @@ -287,9 +287,9 @@ function locked( $item = array(), $model = null )
return false;
}

switch ( strtolower( $item[$model]['locked'] ) )
{
switch ( strtolower( $item[$model]['locked'] ) ){
case 1:
$this->Time = new TimeHelper();
$image = $this->Html->image(
$this->Image->getRelativePath( 'status', 'locked' ),
array(
Expand All @@ -301,6 +301,7 @@ function locked( $item = array(), $model = null )
$item['Locker']['username'] )
)
);
unset($this->Time);
break;

case 0:
Expand Down
4 changes: 1 addition & 3 deletions infinitas/blog/blog_app_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ class BlogAppController extends AppController {
* The helpers that the blog plugin needs to function
*/
var $helpers = array(
// cake helpers
'Time', 'Text', 'Form',
// core helpers
'Libs.TagCloud',
// plugin helpers
'Blog.Blog', 'Google.Chart',
// layout helpers
'Blog.PostLayout', 'Blog.CommentLayout'
);
);

/**
* beforeFilter callback
Expand Down
35 changes: 18 additions & 17 deletions infinitas/blog/models/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,24 @@ class Post extends BlogAppModel {
);

var $hasAndBelongsToMany = array(
'Tag' =>
array(
'className' => 'Blog.Tag',
'foreignKey' => 'post_id',
'associationForeignKey' => 'tag_id',
'with' => 'Blog.PostsTag',
'unique' => true,
'conditions' => '',
'fields' => array('Tag.id', 'Tag.name'),
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);
'Tag' => array(
'className' => 'Blog.Tag',
'joinTable' => 'posts_tags',
'with' => 'Blog.PostsTag',
'foreignKey' => 'post_id',
'associationForeignKey' => 'tag_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);


var $hasMany = array(
);
Expand Down
30 changes: 15 additions & 15 deletions infinitas/blog/models/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ class Tag extends BlogAppModel {
);

var $hasAndBelongsToMany = array(
'Post' =>
array(
'className' => 'Blog.Tag',
'foreignKey' => 'tag_id',
'associationForeignKey' => 'post_id',
'with' => 'Blog.PostsTag',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
'Post' => array(
'className' => 'Blog.Post',
'joinTable' => 'posts_tags',
'with' => 'Blog.PostsTag',
'foreignKey' => 'tag_id',
'associationForeignKey' => 'post_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);

Expand Down
2 changes: 1 addition & 1 deletion infinitas/blog/views/helpers/post_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PostLayoutHelper extends BlogHelper {
// cake helpers
'Time', 'Text', 'Html',
// core helpers
'Libs.Geshi', 'Libs.Status',
'Libs.Geshi',
// blog helpers
'Blog.Blog'
);
Expand Down

0 comments on commit fb1238f

Please sign in to comment.