mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
featurebox front handlers - work in progress
This commit is contained in:
65
e107_plugins/featurebox/includes/category.php
Normal file
65
e107_plugins/featurebox/includes/category.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (c) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Featurebox Category model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/category.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-12-04 18:52:19 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
|
||||
class plugin_featurebox_category extends e_model
|
||||
{
|
||||
/**
|
||||
* @var plugin_featurebox_tree
|
||||
*/
|
||||
protected $_tree = null;
|
||||
/**
|
||||
* Load category data by layout
|
||||
*
|
||||
* @param string $layout
|
||||
* @param boolean $force
|
||||
*/
|
||||
public function loadByLayout($layout, $force = false)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items model tree for the current category
|
||||
* TODO - system cache
|
||||
*
|
||||
* @param boolean $force
|
||||
* @return plugin_featurebox_tree
|
||||
*/
|
||||
public function getTree($force = false)
|
||||
{
|
||||
if($force || null === $this->_tree)
|
||||
{
|
||||
$this->_tree = new plugin_featurebox_tree();
|
||||
$options = array(); // TODO options
|
||||
$this->_tree->load($this->getId(), $options, $force);
|
||||
}
|
||||
|
||||
return $this->_tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set item tree
|
||||
*
|
||||
* @param plugin_featurebox_tree $category_tree
|
||||
* @return plugin_featurebox_category
|
||||
*/
|
||||
public function setTree($category_tree)
|
||||
{
|
||||
$this->_tree = $category_tree;
|
||||
return $this;
|
||||
}
|
||||
}
|
22
e107_plugins/featurebox/includes/item.php
Normal file
22
e107_plugins/featurebox/includes/item.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (c) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Featurebox Item model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-12-04 18:52:19 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
|
||||
// TODO - sc_* methods
|
||||
class plugin_featurebox_item extends e_model
|
||||
{
|
||||
|
||||
}
|
47
e107_plugins/featurebox/includes/tree.php
Normal file
47
e107_plugins/featurebox/includes/tree.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (c) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Featurebox Category Tree model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/tree.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-12-04 18:52:19 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
|
||||
class plugin_featurebox_tree extends e_tree_model
|
||||
{
|
||||
/**
|
||||
* Load tree data
|
||||
* TODO - system cache
|
||||
*
|
||||
* @param integer $category_id
|
||||
* @param array $options
|
||||
* @param boolean $force
|
||||
* @return plugin_featurebox_tree
|
||||
*/
|
||||
public function load($category_id, $options = array(), $force = false)
|
||||
{
|
||||
if(!$force && !$this->isEmpty())
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->setParams(array(
|
||||
'model_class' => 'plugin_featurebox_item',
|
||||
'model_message_stack' => 'featurebox'
|
||||
));
|
||||
|
||||
// TODO - options -> limit, random; set param 'db_query'
|
||||
|
||||
parent::load($force);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user