Internal overhaul
This commit is contained in:
@@ -18,12 +18,6 @@ abstract class Model_Product_Plugin extends ORM_OSB {
|
||||
*/
|
||||
abstract public function cost($annual=FALSE);
|
||||
|
||||
/**
|
||||
* The feature summary should be implemented in plugins.
|
||||
* It is displayed on the product overview page, as a summary of the products features.
|
||||
*/
|
||||
abstract public function feature_summary();
|
||||
|
||||
/**
|
||||
* Return the name of the plugin
|
||||
*/
|
||||
@@ -31,12 +25,38 @@ abstract class Model_Product_Plugin extends ORM_OSB {
|
||||
return strtolower(preg_replace('/(.*)_([a-zA-Z]+)$/',"$2",get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the products using this plugin
|
||||
*/
|
||||
public function products($active=FALSE) {
|
||||
$x = ORM::factory('Product')
|
||||
->where('prod_plugin_file','=',$this->plugin())
|
||||
->and_where('prod_plugin_data','=',$this);
|
||||
|
||||
if ($active)
|
||||
$x->where_active();
|
||||
|
||||
return $x->find_all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Form info for admins to update with plugin data
|
||||
*/
|
||||
abstract public function render_edit();
|
||||
|
||||
abstract public function render_order();
|
||||
/**
|
||||
* Form used during service ordering
|
||||
*/
|
||||
public function render_order() {
|
||||
return View::factory(sprintf('product/plugin/%s/order',$this->plugin()));
|
||||
}
|
||||
|
||||
/**
|
||||
* View the details of the product
|
||||
*/
|
||||
public function render_view() {
|
||||
return View::factory(sprintf('product/plugin/%s/view',$this->plugin()))->set('o',$this);
|
||||
}
|
||||
|
||||
abstract public function supplier();
|
||||
}
|
||||
|
Reference in New Issue
Block a user