Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Building out summaries view of articles component.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchisari authored and The Appleseed Project committed Oct 5, 2010
1 parent 1b403de commit 5be2520
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 10 deletions.
70 changes: 70 additions & 0 deletions components/articles/controllers/summaries.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/**
* @version $Id$
* @package Appleseed.Components
* @subpackage Summaries
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved.
* @link http://opensource.appleseedproject.org
* @license GNU General Public License version 2.0 (See LICENSE.txt)
*/

// Restrict direct access
defined( 'APPLESEED' ) or die( 'Direct Access Denied' );

/** Articles Component Controller
*
* Articles Component Summaries Controller Class
*
* @package Appleseed.Components
* @subpackage Articles
*/
class cArticlesSummariesController extends cController {

/**
* Constructor
*
* @access public
*/
public function __construct ( ) {
parent::__construct( );
}

public function Display ( $pView = null, $pData = array ( ) ) {

$this->View = $this->GetView ( "summaries" );

$this->Model = $this->GetModel();

$this->_Prep();

$this->View->Display();

return ( true );
}

private function _Prep ( ) {

list ( $this->_PageStart, $this->_PageStep, $this->_Page ) = $this->_PageCalc();

$this->Model->GetArticles();

}

private function _PageCalc ( ) {

$page = $this->GetSys ( 'Request' )->Get ( 'Page');

if ( !$page ) $page = 1;

$step = 10;

// Calculate the starting point in the list.
$start = ( $page - 1 ) * $step;

$return = array ( $start, $step, $page );

return ( $return );
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,30 @@
// Restrict direct access
defined( 'APPLESEED' ) or die( 'Direct Access Denied' );

/** Articles Component Controller
/** Articles Component Circles Model
*
* Articles Component Controller Class
* Articles Component Circles Model Class
*
* @package Appleseed.Components
* @subpackage Articles
*/
class cArticlesArticlesController extends cController {
class cArticlesModel extends cModel {

protected $_Tablename = "contentArticles";

/**
* Constructor
*
* @access public
*/
public function __construct ( ) {
parent::__construct( );
public function __construct ( $pTables = null ) {
parent::__construct( $pTables );
}

function Display ( $pView = null, $pData = array ( ) ) {
return ( parent::Display( $pView, $pData ) );
public function GetArticles() {

$this->Retrieve ( array ( "Verification" => 1 ) );

}

}
}
2 changes: 1 addition & 1 deletion foundations/default/frontpage/frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</div>
<div id="appleseed-frontpage-content" class="grid_12 omega">
<section id="frontpage-content">
<?php $zApp->Components->Go ( "articles", "articles", "articles" ); ?>
<?php $zApp->Components->Go ( "articles", "summaries", "summaries" ); ?>
</section>
</div>
</div>
Expand Down

0 comments on commit 5be2520

Please sign in to comment.