Internal overhaul
This commit is contained in:
@@ -11,16 +11,14 @@
|
||||
*/
|
||||
class Model_Service_Plugin_Domain extends Model_Service_Plugin {
|
||||
protected $_table_name = 'service__domain';
|
||||
protected $_created_column = FALSE;
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'),
|
||||
'domain_registrar'=>array('foreign_key'=>'id','far_key'=>'domain_registrar_id'),
|
||||
'service_plugin_host'=>array('through'=>'service','far_key'=>'service_id','foreign_key'=>'service_id'),
|
||||
);
|
||||
protected $_belongs_to = array(
|
||||
'service'=>array(),
|
||||
'host'=>array('model'=>'Service_Plugin_Host','through'=>'service','far_key'=>'service_id','foreign_key'=>'service_id'),
|
||||
'registrar'=>array('model'=>'Domain_Registrar','foreign_key'=>'id','far_key'=>'domain_registrar_id'),
|
||||
'tld'=>array('model'=>'Domain_TLD','foreign_key'=>'id','far_key'=>'domain_tld_id'),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
@@ -35,44 +33,41 @@ class Model_Service_Plugin_Domain extends Model_Service_Plugin {
|
||||
),
|
||||
);
|
||||
|
||||
protected $_save_message = TRUE;
|
||||
|
||||
// Required abstract functions
|
||||
public function admin_update() {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function expire() {
|
||||
return $this->domain_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 service_name() {
|
||||
return sprintf('%s - %s',_('Domain Name License'),$this->name());
|
||||
public function password() {
|
||||
return $this->registrar_password;
|
||||
}
|
||||
|
||||
public function username_value() {
|
||||
public function username() {
|
||||
return $this->registrar_username;
|
||||
}
|
||||
|
||||
public function password_value() {
|
||||
return $this->registrar_password;
|
||||
}
|
||||
// Local functions
|
||||
|
||||
/**
|
||||
* This provides us with a manage button to jump to the registrar
|
||||
* to manage the domain.
|
||||
*/
|
||||
public function manage_button($t='') {
|
||||
if (! parent::manage_button($t))
|
||||
if (! parent::manage())
|
||||
return NULL;
|
||||
|
||||
return ($this->username_value() AND $this->password_value()) ? $this->domain_registrar->manage_button($this,$t) : _('Please contact us');
|
||||
return ($this->username() AND $this->password()) ? $this->registrar->manage_button($this,$t) : _('Please contact us');
|
||||
}
|
||||
|
||||
public function manage_dns_button() {
|
||||
return $this->service_plugin_host->manage_button('service_plugin_host');
|
||||
public function manage_button_dns() {
|
||||
return $this->host->manage_button('host');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user