Internal overhaul
This commit is contained in:
@@ -10,10 +10,6 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Product_Plugin_Host extends Model_Product_Plugin {
|
||||
// @todo This model doesnt have a database table
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
// Our required abstract methods
|
||||
public function cost($annual=FALSE) {
|
||||
// @todo
|
||||
@@ -22,8 +18,6 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
|
||||
return $annual ? $x*12 : $x;
|
||||
}
|
||||
|
||||
public function feature_summary() {}
|
||||
|
||||
public function render_edit() {}
|
||||
|
||||
// @todo
|
||||
@@ -31,6 +25,17 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
|
||||
return 'internal';
|
||||
}
|
||||
|
||||
// Overload functions
|
||||
|
||||
// @todo This model doesnt have a database table
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
// Not used
|
||||
public function render_view() {}
|
||||
|
||||
// Local functions
|
||||
|
||||
// @todo This is not used, but should be.
|
||||
public function order_features() {}
|
||||
}
|
||||
|
@@ -19,8 +19,8 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
|
||||
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'),
|
||||
'host_server'=>array('far_key'=>'host_server_id','foreign_key'=>'id'),
|
||||
'host'=>array('model'=>'Host_Server','far_key'=>'host_server_id','foreign_key'=>'id'),
|
||||
'tld'=>array('model'=>'Domain_TLD','foreign_key'=>'id','far_key'=>'domain_tld_id'),
|
||||
);
|
||||
protected $_belongs_to = array(
|
||||
'service'=>array(),
|
||||
@@ -35,40 +35,41 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
|
||||
),
|
||||
);
|
||||
|
||||
protected $_save_message = TRUE;
|
||||
|
||||
// Required abstract functions
|
||||
public function admin_update() {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function expire() {
|
||||
return $this->host_expire;
|
||||
}
|
||||
|
||||
|
||||
public function name() {
|
||||
return sprintf('%s.%s',$this->display('domain_name'),$this->domain_TLD->display('name'));
|
||||
return sprintf('%s.%s',$this->display('domain_name'),$this->tld->display('name'));
|
||||
}
|
||||
|
||||
public function username_value() {
|
||||
public function password() {
|
||||
return $this->host_password;
|
||||
}
|
||||
|
||||
public function username() {
|
||||
return $this->host_username;
|
||||
}
|
||||
|
||||
public function password_value() {
|
||||
return $this->host_password;
|
||||
}
|
||||
// Local functions
|
||||
|
||||
/**
|
||||
* This provides us with a manage button to jump to the hosting server
|
||||
* to manage the domain.
|
||||
*/
|
||||
public function manage_button($t='') {
|
||||
if (! parent::manage_button($t))
|
||||
return NULL;
|
||||
|
||||
// @todo Convert this to a Static_List display
|
||||
if ($this->service->queue == 'PROVISION')
|
||||
return _('To Be Provisioned');
|
||||
|
||||
return ($this->username_value() AND $this->password_value() AND $a=$this->host_server->plugin()) ? $a->manage_button($this,$t) : '';
|
||||
if (! parent::manage($t))
|
||||
return NULL;
|
||||
|
||||
return ($this->username() AND $this->password() AND $a=$this->host->plugin()) ? $a->manage_button($this,$t) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -4,49 +4,49 @@
|
||||
</div> <!-- /page-title -->
|
||||
|
||||
<div id="container">
|
||||
<div class="row">
|
||||
<div class="grid-12">
|
||||
<div class="pricing-plans plans-4">
|
||||
<div class="row">
|
||||
<?php $c=0; foreach ($o->products() as $po) : ?>
|
||||
<?php if (! ($c++%4) AND $c>1) : ?>
|
||||
</div> <!-- /row -->
|
||||
<hr class="row-divider" />
|
||||
<div class="row">
|
||||
<?php endif ?>
|
||||
<div class="pricing-plans plans-4">
|
||||
<div class="row">
|
||||
<?php $c=0; foreach ($o->products() as $po) : ?>
|
||||
<?php $go = $po->price_best($o->recur_schedule,TRUE); ?>
|
||||
<?php $price = (string)Currency::display($po->price($go->id,$o->recur_schedule,'base',TRUE)); ?>
|
||||
|
||||
<div class="plan-container">
|
||||
<div class="plan">
|
||||
<?php if (is_null($price)) continue; ?>
|
||||
|
||||
<div class="plan-header">
|
||||
<?php if (! ($c++%4) AND $c>1) : ?>
|
||||
</div> <!-- /row -->
|
||||
<hr class="row-divider" />
|
||||
<div class="row">
|
||||
<?php endif ?>
|
||||
|
||||
<div class="plan-title">
|
||||
<?php echo $po->title(); ?>
|
||||
</div> <!-- /plan-title -->
|
||||
<div class="plan-container">
|
||||
<div class="plan">
|
||||
|
||||
<div class="plan-price">
|
||||
<?php $x = (string)Currency::display($po->price(0,4,'price_base',TRUE)); ?>
|
||||
<span class="note">$</span><?php echo substr($x,0,strpos($x,'.')); ?><span class="cents"> .<?php echo substr($x,-2,strpos($x,'.')); ?></span><span class="term"><?php echo StaticList_RecurSchedule::get(4); ?></span>
|
||||
</div> <!-- /plan-price -->
|
||||
<div class="plan-header">
|
||||
|
||||
</div> <!-- /plan-header -->
|
||||
<div class="plan-title">
|
||||
<?php echo $po->title(); ?>
|
||||
</div> <!-- /plan-title -->
|
||||
|
||||
<div class="plan-features">
|
||||
<ul>
|
||||
<li><span class="note">$</span><strong><?php echo Currency::display($po->price(0,4,'price_setup',TRUE)); ?></strong> setup</li>
|
||||
</ul>
|
||||
</div> <!-- /plan-features -->
|
||||
<div class="plan-price">
|
||||
<span class="note">$</span><?php echo substr($price,0,strpos($price,'.')); ?><span class="cents"> .<?php echo substr($price,-2,strpos($price,'.')); ?></span><span class="term"><?php echo StaticList_RecurSchedule::get($o->recur_schedule); ?></span>
|
||||
</div> <!-- /plan-price -->
|
||||
|
||||
<div class="plan-actions">
|
||||
<a href="<?php echo URL::site('product/view/'.$po->id); ?>" class="btn">More Information</a>
|
||||
</div> <!-- /plan-actions -->
|
||||
</div> <!-- /plan-header -->
|
||||
|
||||
</div> <!-- /plan -->
|
||||
</div> <!-- /plan-container -->
|
||||
<?php endforeach ?>
|
||||
<div class="plan-features">
|
||||
<ul>
|
||||
<li><span class="note">$</span><strong><?php echo Currency::display($po->price($go->id,$o->recur_schedule,'setup',TRUE)); ?></strong> Setup</li>
|
||||
</ul>
|
||||
</div> <!-- /plan-features -->
|
||||
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /pricing-plans -->
|
||||
</div> <!-- /grid -->
|
||||
</div> <!-- /row -->
|
||||
<div class="plan-actions">
|
||||
<a href="<?php echo URL::site('product/view/'.$po->id); ?>" class="btn">More Information</a>
|
||||
</div> <!-- /plan-actions -->
|
||||
|
||||
</div> <!-- /plan -->
|
||||
</div> <!-- /plan-container -->
|
||||
<?php endforeach ?>
|
||||
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /pricing-plans -->
|
||||
</div> <!-- /container -->
|
||||
|
Reference in New Issue
Block a user