本文整理汇总了PHP中GetModuleById函数的典型用法代码示例。如果您正苦于以下问题:PHP GetModuleById函数的具体用法?PHP GetModuleById怎么用?PHP GetModuleById使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetModuleById函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleProviderAction
/**
* Handles XHR 'providerAction 'requests from the settings > email integration forms, and routes them to the correct provider module
*
* @param array $data
*/
public function handleProviderAction($data)
{
$providerAction = $data['providerAction'];
$provider = $data['provider'];
unset($data['providerAction'], $data['provider']);
GetModuleById('emailintegration', /** @var ISC_EMAILINTEGRATION */$module, $provider);
if (!$module) {
ISC_JSON::output('Unknown module: ' . $provider, false);
return;
}
$method = 'remote' . $providerAction;
if (!is_callable(array($module, $method))) {
ISC_JSON::output('Provider action not "' . $providerAction . '" found for provider "' . $provider . '"', false);
return;
}
// api auth details will be included in the request, based on the form - this should be separated before sending it to the provider module
$auth = @$data['auth'];
if (!$auth) {
$auth = array();
}
unset($data['auth']);
$result = $module->$method($auth, $data);
// result expected from provider module is array containing at least 'message' and 'success'; any other elements will be sent back as json too but message and success are stripped out and handled separately due to how ISC_JSON works
$message = @$result['message'];
$success = !!$result['success'];
unset($result['message'], $result['success']);
ISC_JSON::output($message, $success, $result);
}
示例2: __construct
/**
* Constructor
*
* Base constructor
*
* @access public
* @param string $op The operation to preform
* @param array &$data The referenced data array
* @param array &$parent The referenced handler parent object
*/
public function __construct($op, &$data, &$parent)
{
parent::__construct($op, $data, $parent);
GetModuleById('accounting', $this->quickbooks, 'accounting_quickbooks');
$this->xmlNode = new XMLWriter();
$this->xmlNode->openMemory();
}
示例3: HandleSupport
private function HandleSupport()
{
$accounting = null;
if (!array_key_exists('accounting', $_REQUEST) || !GetModuleById('accounting', $accounting, $_REQUEST['accounting'])) {
exit;
}
header('Location: ' . $accounting->_supporturl);
exit;
}
示例4: getSelectedModule
/**
* Get the selected module
*
* Method will return the selected module
*
* @access private
* @return object the selected module on success, FALSE if the module could not be found
*/
private function getSelectedModule()
{
$module = null;
if (!array_key_exists("accounting", $_GET) || !GetModuleById("accounting", $module, $_GET["accounting"])) {
return false;
}
return $module;
}
示例5: __construct
/**
* Constructor
*
* Base constructor
*
* @access public
* @param string $op The operation to preform
* @param array &$data The referenced data array
* @param array &$parent The referenced handler parent object
*/
public function __construct($op, &$data, &$parent)
{
parent::__construct($op, $data, $parent);
$this->entity = new ACCOUNTING_QUICKBOOKS_ENTITIES();
GetModuleById('accounting', $this->quickbooks, 'accounting_quickbooks');
/**
* Now assign the spool data
*/
$this->spoolId = $this->data->spoolId;
$this->spoolData = $this->quickbooks->getAccountingSpool($this->data->spoolId);
}
示例6: GetTrackingCodeForAllPackages
/**
* Return the tracking code for all of the enabled analytics modules.
*
* @return string The tracking code to be inserted on pages.
*/
function GetTrackingCodeForAllPackages()
{
$packages = GetAvailableModules('analytics', true, true);
$code = "";
foreach ($packages as $package) {
if (GetModuleById('analytics', $module, $package['id'])) {
$trackingCode = $module->GetTrackingCode();
}
$code .= "<!-- Start Tracking Code for " . $package['id'] . " -->\n\n" . $trackingCode . "\n\n<!-- End Tracking Code for " . $package['id'] . " -->\n\n";
}
return $code;
}
示例7: perform
public function perform()
{
$moduleId = $this->args['module'];
GetModuleById('emailintegration', /** @var EMAILINTEGRATION_MAILCHIMP */$module, $moduleId);
$listId = $this->args['listId'];
$subscription = unserialize($this->args['subscription']);
$fields = $this->args['fields'];
$result = $module->addSubscriberToList($listId, $subscription, $fields, false);
return $result->success;
}
示例8: perform
public function perform()
{
$moduleId = $this->args['module'];
GetModuleById('emailintegration', /** @var EMAILINTEGRATION_MAILCHIMP */$module, $moduleId);
$listId = $this->args['listId'];
$email = $this->args['email'];
$subscription = new Interspire_EmailIntegration_Subscription_Newsletter($email, '');
$result = $module->removeSubscriberFromList($listId, $subscription, false);
return $result->success;
}
示例9: handleManager
public function handleManager()
{
if (!isset($_GET['manager'])) {
exit;
}
$manager = 'shippingmanager_' . $_GET['manager'];
if (!GetModuleById('shippingmanager', $module, $manager) || !$module->IsEnabled() || !method_exists($module, 'handleAction')) {
exit;
}
$module->handleAction();
}
示例10: __construct
/**
* The constructor. If you pass in xml_response then it will automatically call HandleRequest for you too
*
* @return void
**/
public function __construct($xml_response = null)
{
// If the google checkout module is not enabled and configured we don't need to do anything
GetModuleById('checkout', $this->module, 'checkout_googlecheckout');
if (!$this->module) {
$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', 'checkout_googlecheckout'), 'Google checkout not configured.');
die;
}
$this->logtype = array('payment', $this->module->_name);
require_once dirname(__FILE__) . '/library/googleresponse.php';
$this->response = new GoogleResponse($this->module->GetValue('merchantid'), $this->module->GetValue('merchanttoken'));
if ($xml_response !== null) {
$this->HandleRequest($xml_response);
}
}
示例11: SetPanelSettings
public function SetPanelSettings()
{
// get our comments system
if (!GetModuleById('comments', /** @var ISC_COMMENTS **/$commentsModule, GetConfig('CommentSystemModule'))) {
$this->DontDisplay = true;
return;
}
if (!$commentsModule->commentsEnabledForType(ISC_COMMENTS::PRODUCT_COMMENTS)) {
$this->DontDisplay = true;
return;
}
$GLOBALS['CommentsHTML'] = $commentsModule->getCommentsHTMLForType(ISC_COMMENTS::PRODUCT_COMMENTS, $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId());
}
示例12: SetPanelSettings
public function SetPanelSettings()
{
// get our comments system
if (!GetModuleById('comments', /** @var ISC_COMMENTS **/$commentsModule, GetConfig('CommentSystemModule'))) {
$this->DontDisplay = true;
return;
}
$pageId = $GLOBALS['ISC_CLASS_PAGE']->GetPageId();
if (!$commentsModule->commentsEnabledForType(ISC_COMMENTS::PAGE_COMMENTS) || !$commentsModule->pageEnabled($pageId)) {
$this->DontDisplay = true;
return;
}
$GLOBALS['CommentsHTML'] = $commentsModule->getCommentsHTMLForType(ISC_COMMENTS::PAGE_COMMENTS, $pageId);
}
示例13: update_simplepay_checkout_module
public function update_simplepay_checkout_module()
{
if (!ModuleIsConfigured('checkout_paysimple')) {
return true;
}
GetModuleById('checkout', $module, 'checkout_paysimple');
// Check to see if the module hasn't already been updated
$value = $module->GetValue('merchantkey');
if (!is_null($value) && trim($value) !== '') {
return true;
}
// OK, it hasn't been updated yet, so do so
$keyFile = ISC_BASE_PATH . "/modules/checkout/paysimple/lib/keyHalf.txt";
if (!file_exists($keyFile)) {
return true;
}
if (!is_readable($keyFile)) {
$this->SetError('Unable to read the key file ' . GetConfig('AppPath') . '/modules/checkout/paysimple/lib/keyHalf.txt. Please CHMOD it to 646 or 666.');
return false;
}
$newKey = @file_get_contents(ISC_BASE_PATH . "/modules/checkout/paysimple/lib/keyHalf.txt");
$newKey = trim($newKey);
if ($newKey == '') {
return true;
}
// Make sure you get the 'static' part
$newKey = Interspire_String::toUnixLineEndings($newKey);
$newKey = explode("\n", $newKey);
$newKey = $newKey[0];
$module->setMerchantKey($newKey);
return true;
}
示例14: perform
public function perform()
{
$_engine = getClass('ISC_ADMIN_ENGINE');
$_engine->LoadLangFile('shoppingcomparison');
$moduleId = $this->args['module'];
GetModuleById('shoppingcomparison', $module, $moduleId);
if(!$module)
return;
if(!isset($this->args['controller'])
|| !($controllerId = $this->args['controller']))
{
error_log("No controller for export task. Aborting");
return;
}
$this->initialize($module, $controllerId);
$this->run();
}
示例15: SetOrderData
private function SetOrderData()
{
// Some payment providers like WorldPay simply "fetch" FinishOrder.php and so it
// doesn't factor in cookies stored by Unreal Shopping Cart, so we have to pass back the
// order token manually from those payment providers. We do this by taking the
// cart ID passed back from the provider which stores the order's unique token.
if(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {
$this->orderToken = $_COOKIE['SHOP_ORDER_TOKEN'];
}
else if(isset($_REQUEST['provider'])) {
GetModuleById('checkout', $this->paymentProvider, $_REQUEST['provider']);
if(in_array("GetOrderToken", get_class_methods($this->paymentProvider))) {
$this->orderToken = $this->paymentProvider->GetOrderToken();
}
else {
ob_end_clean();
header(sprintf("Location:%s", $GLOBALS['ShopPath']));
die();
}
}
// Load the pending orders from the database
$this->pendingData = LoadPendingOrdersByToken($this->orderToken, true);
if(!$this->orderToken || $this->pendingData === false) {
$this->BadOrder();
exit;
}
if($this->paymentProvider === null) {
GetModuleById('checkout', $this->paymentProvider, $this->pendingData['paymentmodule']);
}
if($this->paymentProvider) {
$this->paymentProvider->SetOrderData($this->pendingData);
}
}