Fixes to OSB to work with KH 3.3
This commit is contained in:
72
modules/host/classes/Model/Host/Server.php
Normal file
72
modules/host/classes/Model/Host/Server.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports OSB Web Hosting
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Host_Server extends ORM_OSB {
|
||||
// Host Server doesnt use the update column
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
protected $_serialize_column = array(
|
||||
'provision_plugin_data',
|
||||
);
|
||||
|
||||
/**
|
||||
* Return the object of the product plugin
|
||||
*/
|
||||
public function plugin($type='') {
|
||||
$c = sprintf('Host_Plugin_%s',$this->provision_plugin);
|
||||
|
||||
if (! $this->provision_plugin OR ! class_exists($c))
|
||||
return NULL;
|
||||
|
||||
$o = new $c($this);
|
||||
|
||||
return $type ? $o->$type : $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the plugin to update
|
||||
*/
|
||||
public function admin_update() {
|
||||
if (is_null($plugin = $this->plugin()))
|
||||
return NULL;
|
||||
else
|
||||
return $plugin->admin_update();
|
||||
}
|
||||
|
||||
public function manage_button($t='') {
|
||||
static $k = '';
|
||||
|
||||
// If $k is already set, we've rendered this JS
|
||||
if (! $k) {
|
||||
$k = Random::char();
|
||||
Session::instance()->set('manage_button',$k);
|
||||
|
||||
Script::add(array('type'=>'stdin','data'=>'
|
||||
$(document).ready(function() {
|
||||
var x=0;
|
||||
$("button[name=submit]").click(function() {
|
||||
var t=$(this).val().split(":");
|
||||
if (x++) { alert("Session expired, please refresh the page!"); return false; }
|
||||
$.getJSON("'.URL::site('admin/host/ajaxmanage/'.$this->id).'", { k: "'.$k.'",t: t[1] }, function(data) {
|
||||
$.each(data, function(key, val) { $("#"+key+"_"+t[0]+"_"+t[1]).val(val); });
|
||||
})
|
||||
.error(function() { alert("There was a problem with the request"); return false; })
|
||||
.success(function() { $("form[id=id_"+t[0]+"_"+t[1]+"]").submit(); });
|
||||
});
|
||||
});'
|
||||
));
|
||||
}
|
||||
|
||||
return is_null($this->plugin()) ? '' : $this->plugin()->admin_manage_button($this,$t);
|
||||
}
|
||||
}
|
||||
?>
|
15
modules/host/classes/Model/Host/Server/Affiliate.php
Normal file
15
modules/host/classes/Model/Host/Server/Affiliate.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports affiliates Host Server Configuration
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage HostServer/Affiliate
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Host_Server_Affiliate extends ORM_OSB {
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user