@@ -432,6 +432,23 @@ class PMPlugin
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* callBack File on reassign
|
||||
*
|
||||
* @param string $callBackFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerOpenReassignCallback($callBackFile = '')
|
||||
{
|
||||
try {
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerOpenReassignCallback($callBackFile);
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
@@ -788,4 +805,20 @@ class importCallBack
|
||||
$this->namespace = $namespace;
|
||||
$this->callBackFile = $callBackFile;
|
||||
}
|
||||
}
|
||||
|
||||
class OpenReassignCallback
|
||||
{
|
||||
public $callBackFile;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the cronFile class
|
||||
* param string $namespace
|
||||
* param string $callBackFile
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($callBackFile)
|
||||
{
|
||||
$this->callBackFile = $callBackFile;
|
||||
}
|
||||
}
|
||||
@@ -104,6 +104,7 @@ class PMPluginRegistry
|
||||
private $_arrayDesignerMenu = array();
|
||||
private $_aMenuOptionsToReplace = array ();
|
||||
private $_aImportProcessCallbackFile = array ();
|
||||
private $_aOpenReassignCallback = array ();
|
||||
|
||||
/**
|
||||
* Registry a plugin javascript to include with js core at same runtime
|
||||
@@ -413,7 +414,10 @@ class PMPluginRegistry
|
||||
if(sizeof( $this->_aImportProcessCallbackFile )){
|
||||
unset( $this->_aImportProcessCallbackFile );
|
||||
}
|
||||
|
||||
|
||||
if(sizeof( $this->_aOpenReassignCallback )){
|
||||
unset( $this->_aOpenReassignCallback );
|
||||
}
|
||||
//unregistering javascripts from this plugin
|
||||
$this->unregisterJavascripts( $sNamespace );
|
||||
//unregistering rest services from this plugin
|
||||
@@ -1748,5 +1752,42 @@ class PMPluginRegistry
|
||||
{
|
||||
return $this->_aImportProcessCallbackFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a callBackFile in the singleton
|
||||
*
|
||||
* @param string $callBackFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerOpenReassignCallback ($callBackFile)
|
||||
{
|
||||
try {
|
||||
$found = false;
|
||||
foreach ($this->_aOpenReassignCallback as $row => $detail) {
|
||||
if ($callBackFile == $detail->callBackFile) {
|
||||
$detail->callBackFile = $callBackFile;
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$callBackFile = new OpenReassignCallback( $callBackFile );
|
||||
$this->_aOpenReassignCallback[] = $callBackFile;
|
||||
}
|
||||
} catch(Excepton $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all callBackFiles registered
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOpenReassignCallback()
|
||||
{
|
||||
return $this->_aOpenReassignCallback;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ class System
|
||||
'error_reporting' => "",
|
||||
'display_errors' => 'On',
|
||||
'system_utc_time_zone' => 0,
|
||||
'server_protocol' => '',
|
||||
'server_hostname_requests_frontend' => ''
|
||||
);
|
||||
|
||||
@@ -1265,11 +1266,14 @@ class System
|
||||
try {
|
||||
$arraySystemConfiguration = self::getSystemConfiguration();
|
||||
|
||||
$serverProtocol = $arraySystemConfiguration['server_protocol'];
|
||||
$serverProtocol = ($serverProtocol != '')? $serverProtocol : ((G::is_https())? 'https' : 'http');
|
||||
|
||||
$serverHostname = $arraySystemConfiguration['server_hostname_requests_frontend'];
|
||||
$serverHostname = ($serverHostname != '')? $serverHostname : $_SERVER['HTTP_HOST'];
|
||||
|
||||
//Return
|
||||
return ((G::is_https())? 'https://' : 'http://') . $serverHostname;
|
||||
return $serverProtocol . '://' . $serverHostname;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user