本文整理汇总了PHP中MagebridgeModelConfig类的典型用法代码示例。如果您正苦于以下问题:PHP MagebridgeModelConfig类的具体用法?PHP MagebridgeModelConfig怎么用?PHP MagebridgeModelConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MagebridgeModelConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setMessages
/**
* Method to set the messages
*/
public function setMessages()
{
if (MagebridgeModelConfig::load('enable_messages') == 0) {
return false;
}
$messages = $this->getResponseData();
if (!empty($messages) && is_array($messages)) {
$application = JFactory::getApplication();
foreach ($messages as $message) {
if (!is_array($message)) {
continue;
}
switch ($message['type']) {
case 'warning':
$type = 'warning';
break;
case 'error':
$type = 'error';
break;
default:
$type = 'message';
break;
}
$application->enqueueMessage($message['message'], $type);
}
}
return true;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:31,代码来源:messages.php
示例2: getInput
protected function getInput()
{
$name = $this->name;
$fieldName = $name;
$value = $this->value;
if (MagebridgeModelConfig::load('api_widgets') == true) {
$cache = JFactory::getCache('com_magebridge_admin');
$cache->setCaching(0);
$options = $cache->call(array('JElementStoreview', 'getResult'));
// Parse the result into an HTML form-field
if (!empty($options) && is_array($options)) {
foreach ($options as $index => $option) {
if (!isset($option[$return])) {
$return = 'value';
}
$option['label'] = $option['label'] . ' (' . $option[$return] . ') ';
$option['value'] = $option[$return];
$options[$index] = $option;
}
array_unshift($options, array('value' => '', 'label' => ''));
return JHTML::_('select.genericlist', $options, $fieldName, null, 'value', 'label', $value);
} else {
MageBridgeModelDebug::getInstance()->warning('Unable to obtain MageBridge API Widget "storeview": ' . var_export($options, true));
}
}
return '<input type="text" name="' . $fieldName . '" value="' . $value . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:27,代码来源:storeview.php
示例3: getInput
protected function getInput()
{
$name = $this->name;
$fieldName = $name;
$value = $this->value;
// Are the API widgets enabled?
if (MagebridgeModelConfig::load('api_widgets') == true) {
// Load the javascript
JHTML::script('media/com_magebridge/js/backend-elements.js');
JHTML::_('behavior.modal', 'a.modal');
$returnType = (string) $this->element['return'];
$title = $value;
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
$link = 'index.php?option=com_magebridge&view=element&tmpl=component&type=customer&object=' . $name . '&return=' . $returnType . '&current=' . $value;
$html = '<div style="float: left;">';
$html .= '<input type="text" id="' . $name . '_name" value="' . $title . '" disabled="disabled" />';
$html .= '</div>';
$html .= '<div class="button2-left"><div class="blank">';
$html .= '<a class="modal" title="' . JText::_('Select a Customer') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x:800, y:450}}">' . JText::_('Select') . '</a>';
$html .= '</div></div>' . "\n";
$html .= '<input type="hidden" id="' . $name . '_id" name="' . $fieldName . '" value="' . $value . '" />';
return $html;
}
return '<input type="text" name="' . $fieldName . '" value="' . $value . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:25,代码来源:customer.php
示例4: getInput
/**
* Method to get the HTML of this element
*
* @param null
* @return string
*/
protected function getInput()
{
$name = $this->name;
$value = $this->value;
$id = preg_replace('/([^0-9a-zA-Z]+)/', '_', $name);
// Are the API widgets enabled?
if (MagebridgeModelConfig::load('api_widgets') == true) {
// Load the javascript
JHTML::script('media/com_magebridge/js/backend-elements.js');
JHTML::_('behavior.modal', 'a.modal');
$returnType = (string) $this->element['return'];
if (empty($returnType)) {
$returnType = 'sku';
}
$title = $value;
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
$link = 'index.php?option=com_magebridge&view=element&tmpl=component&ajax=1';
$link .= '&type=product&object=' . $id . '&return=' . $returnType . '&current=' . $value;
$html = array();
$html[] = '<span class="input-append">';
$html[] = '<input type="text" class="input-medium" id="' . $id . '" name="' . $name . '" value="' . $title . '" size="35" />';
$html[] = '<a class="modal btn" role="button" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('JSELECT') . '</a>';
$html[] = '</span>';
$html = implode("\n", $html);
return $html;
}
return '<input type="text" name="' . $name . '" value="' . $value . '" />';
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:34,代码来源:product.php
示例5: export
/**
* Method to export users to CSV
*
* @param null
* @return null
*/
public function export()
{
// Gather the variables
$users = $this->getUserList();
$website_id = MagebridgeModelConfig::load('users_website_id');
$group_id = MagebridgeModelConfig::load('users_group_id');
// Perform preliminary checks
if (empty($users)) {
$this->setRedirect('index.php?option=com_magebridge&view=users', JText::_('No users found'), 'error');
return false;
}
if (empty($website_id)) {
$this->setRedirect('index.php?option=com_magebridge&view=users', JText::_('Website not configured in export parameters'), 'error');
return false;
}
if (empty($group_id)) {
$this->setRedirect('index.php?option=com_magebridge&view=users', JText::_('Customer Group not configured in export parameters'), 'error');
return false;
}
$date = date('Ymd');
$filename = 'magebridge-export-joomla-users_' . $date . '.csv';
$output = $this->getOutput($users, $website_id, $group_id);
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Length: ' . YireoHelper::strlen($output));
header('Content-type: text/x-csv');
header('Content-Disposition: attachment; filename=' . $filename);
print $output;
// Close the application
$application = JFactory::getApplication();
$application->close();
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:37,代码来源:users.php
示例6: load
public static function load()
{
if (MagebridgeModelConfig::load('preload_all_modules') == 0 && JRequest::getInt('Itemid') != 0) {
static $modules = null;
if (is_array($modules) == false) {
$modules = JModuleHelper::_load();
foreach ($modules as $index => $module) {
if (strstr($module->module, 'mod_magebridge') == false) {
unset($modules[$index]);
}
}
}
return $modules;
}
$application = JFactory::getApplication();
$db = JFactory::getDBO();
$where = array();
$where[] = 'm.published = 1';
$where[] = 'm.module LIKE "mod_magebridge%"';
$where[] = 'm.client_id = ' . (int) $application->getClientId();
$query = 'SELECT m.*' . ' FROM #__modules AS m' . ' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id' . ' WHERE ' . implode(' AND ', $where) . ' ORDER BY m.position, m.ordering';
$db->setQuery($query);
$modules = $db->loadObjectList();
return $modules;
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:25,代码来源:module.php
示例7: fetchElement
public function fetchElement($name, $value, $node = null, $control_name = null)
{
if (!empty($control_name)) {
$fieldName = $control_name . '[' . $name . ']';
} else {
$fieldName = $name;
}
// Are the API widgets enabled?
if (MagebridgeModelConfig::load('api_widgets') == true) {
// Load the javascript
JHTML::script('backend-elements.js', 'media/com_magebridge/js/');
JHTML::_('behavior.modal', 'a.modal');
if (!empty($node) && is_object($node)) {
$returnType = $node->attributes('return');
} else {
if (!empty($node) && is_array($node) && !empty($node['return'])) {
$returnType = $node['return'];
} else {
$returnType = 'sku';
}
}
$title = $value;
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
$link = 'index.php?option=com_magebridge&view=element&tmpl=component&ajax=1&type=widget&object=' . $name . '&return=' . $returnType . '&current=' . $value;
$html = '<div style="float: left;">';
$html .= '<input type="text" id="' . $name . '" name="' . $fieldName . '" value="' . $title . '" />';
$html .= '</div>';
$html .= '<div class="button2-left"><div class="blank">';
$html .= '<a class="modal" title="' . JText::_('Select a widget') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x:800, y:450}}">' . JText::_('Select') . '</a>';
$html .= '</div></div>' . "\n";
return $html;
}
return '<input type="text" name="' . $fieldName . '" value="' . $value . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:34,代码来源:widget.php
示例8: getStore
public function getStore()
{
// If the database configuration specified no stores, skip this step
if (MagebridgeModelConfig::load('load_stores') == 0) {
return null;
}
// Get the conditions
$db = JFactory::getDBO();
$db->setQuery("SELECT * FROM #__magebridge_stores WHERE `published`=1 ORDER BY `ordering`");
$conditions = $db->loadObjectList();
if (empty($conditions)) {
return null;
}
// Get the connectors
$connectors = $this->getConnectors();
// Try to match a condition with one of the connectors
foreach ($conditions as $condition) {
foreach ($connectors as $connector) {
if ($condition->connector == $connector->name) {
if ($connector->checkCondition($condition->connector_value) == TRUE) {
$type = $condition->type == 'storeview' ? 'store' : 'group';
return array('type' => $type, 'name' => $condition->name);
}
}
}
}
return null;
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:28,代码来源:store.php
示例9: getInput
protected function getInput()
{
$name = $this->name;
$fieldName = $name;
$value = $this->value;
// Only build a dropdown when the API-widgets are enabled
if (MagebridgeModelConfig::load('api_widgets') == true) {
// Fetch the widget data from the API
$options = MageBridgeWidgetHelper::getWidgetData('website');
// Parse the result into an HTML form-field
if (!empty($options) && is_array($options)) {
foreach ($options as $index => $option) {
// Customize the return-value when the attribute "output" is defined
$output = (string) $this->element['output'];
if (!empty($output) && array_key_exists($output, $option)) {
$option['value'] = $option[$output];
}
// Customize the label
$option['label'] = $option['label'] . ' (' . $option['value'] . ') ';
// Add the option back to the list of options
$options[$index] = $option;
}
// Return a dropdown list
array_unshift($options, array('value' => '', 'label' => ''));
return JHTML::_('select.genericlist', $options, $fieldName, null, 'value', 'label', $value);
// Fetching data from the bridge failed, so report a warning
} else {
MageBridgeModelDebug::getInstance()->warning('Unable to obtain MageBridge API Widget "website": ' . var_export($options, true));
}
}
// Return a simple input-field by default
return '<input type="text" name="' . $fieldName . '" value="' . $value . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:33,代码来源:website.php
示例10: getRequestData
/**
* Method to get the meta-data
*
* @return array
*/
public function getRequestData()
{
// Compile the meta-data
if (empty($this->_meta_data) || !is_array($this->_meta_data)) {
$application = JFactory::getApplication();
$input = $application->input;
$user = JFactory::getUser();
$uri = JURI::getInstance();
$session = JFactory::getSession();
$config = JFactory::getConfig();
$storeHelper = MageBridgeStoreHelper::getInstance();
$bridge = MageBridgeModelBridge::getInstance();
$app_type = $storeHelper->getAppType();
$app_value = $storeHelper->getAppValue();
$arguments = array('api_session' => $bridge->getApiSession(), 'api_user' => MageBridgeEncryptionHelper::encrypt(MagebridgeModelConfig::load('api_user')), 'api_key' => MageBridgeEncryptionHelper::encrypt(MagebridgeModelConfig::load('api_key')), 'api_url' => JURI::root() . 'component/magebridge/?controller=jsonrpc&task=call', 'app' => $application->getClientId(), 'app_type' => $app_type, 'app_value' => $app_value, 'storeview' => MagebridgeModelConfig::load('storeview'), 'storegroup' => MagebridgeModelConfig::load('storegroup'), 'website' => MagebridgeModelConfig::load('website'), 'customer_group' => MagebridgeModelConfig::load('customer_group'), 'joomla_url' => $bridge->getJoomlaBridgeUrl(), 'joomla_sef_url' => $bridge->getJoomlaBridgeSefUrl(), 'joomla_sef_suffix' => (int) MageBridgeUrlHelper::hasUrlSuffix(), 'joomla_user_email' => $application->isSite() && !empty($user->email) ? $user->email : null, 'joomla_current_url' => $uri->current(), 'modify_url' => MagebridgeModelConfig::load('modify_url'), 'enforce_ssl' => MagebridgeModelConfig::load('enforce_ssl'), 'has_ssl' => (int) $uri->isSSL(), 'payment_urls' => MagebridgeModelConfig::load('payment_urls'), 'enable_messages' => MagebridgeModelConfig::load('enable_messages'), 'joomla_session' => session_id(), 'joomla_conf_caching' => $config->get('caching', 60), 'joomla_conf_lifetime' => $config->get('lifetime', 60) * 60, 'magento_session' => $bridge->getMageSession(), 'magento_persistent_session' => $bridge->getMagentoPersistentSession(), 'magento_user_allowed_save_cookie' => isset($_COOKIE['user_allowed_save_cookie']) ? $_COOKIE['user_allowed_save_cookie'] : null, 'request_uri' => MageBridgeUrlHelper::getRequest(), 'request_id' => md5(JURI::current() . serialize($input->get->getArray())), 'post' => !empty($_POST) ? $_POST : null, 'http_referer' => $bridge->getHttpReferer(), 'http_host' => $uri->toString(array('host')), 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'remote_addr' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'supportkey' => MagebridgeModelConfig::load('supportkey'), 'debug' => (int) MageBridgeModelDebug::isDebug(), 'debug_level' => MagebridgeModelConfig::load('debug_level'), 'debug_display_errors' => MagebridgeModelConfig::load('debug_display_errors'), 'protocol' => MagebridgeModelConfig::load('protocol'), 'state' => 'initializing', 'ajax' => (int) $bridge->isAjax(), 'disable_css' => MageBridgeHelper::getDisableCss(), 'disable_js' => MageBridgeHelper::getDisableJs());
if (MageBridgeTemplateHelper::isMobile()) {
$arguments['theme'] = MagebridgeModelConfig::load('mobile_magento_theme');
} else {
$arguments['theme'] = MagebridgeModelConfig::load('magento_theme');
}
foreach ($arguments as $name => $value) {
if (is_string($value)) {
$arguments[$name] = MageBridgeEncryptionHelper::base64_encode($value);
}
}
$this->_meta_data = $arguments;
}
return $this->_meta_data;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:34,代码来源:meta.php
示例11: encrypt
/**
* Encrypt data for security
*
* @param mixed $data
* @return string
*/
public static function encrypt($data)
{
// Don't do anything with empty data
$data = trim($data);
if (empty($data)) {
return null;
}
// Check if encryption was turned off
if (MagebridgeModelConfig::load('encryption') == 0) {
return $data;
}
// Check if SSL is already in use, so encryption is not needed
if (MagebridgeModelConfig::load('protocol') == 'https') {
return $data;
}
// Check for mcrypt
if (!function_exists('mcrypt_get_iv_size') || !function_exists('mcrypt_cfb')) {
return $data;
}
// Generate a random key
$random = str_shuffle('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
$key = MageBridgeEncryptionHelper::getSaltedKey($random);
try {
$td = mcrypt_module_open(MCRYPT_CAST_256, '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted = mcrypt_generic($td, $data);
$encoded = MageBridgeEncryptionHelper::base64_encode($encrypted);
} catch (Exception $e) {
Mage::getSingleton('magebridge/debug')->error("Error while decrypting: " . $e->getMessage());
return null;
}
return $encoded . '|=|' . $random;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:40,代码来源:encryption.php
示例12: call
public function call($call = '', $options = array())
{
if (empty($this->session_id)) {
$api_user = MagebridgeModelConfig::load('api_user');
$api_key = MagebridgeModelConfig::load('api_key');
$msg = new xmlrpcmsg('login', array($this->encode($api_user), $this->encode($api_key)));
$doc = $this->client->send($msg, $this->timeout);
if (!is_object($doc)) {
return JText::_('XML-RPC non-object document: ' . $doc);
}
$value = $doc->value();
if (!is_object($value)) {
return JText::_('XML-RPC non-object value: ' . $value);
}
$this->session_id = $doc->value()->getval();
if (!$this->session_id > 0) {
return JText::_('Empty session ID: ' . $doc->faultString());
}
}
$msg = new xmlrpcmsg('call', array($this->encode($this->session_id), $this->encode($call)));
$doc = $this->client->send($msg, $this->timeout);
if ($doc->faultCode() == 0) {
return $this->decode($doc->value());
} else {
return $doc->faultString();
}
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:27,代码来源:xmlrpc.php
示例13: store
/**
* Method to store the item
*
* @package MageBridge
* @access public
* @param array $data
* @return bool
*/
public function store($data)
{
// Store the item
$rt = parent::store($data);
// Change the setting "load_urls" in the MageBridge configuration
if ($data['published'] == 1) {
MagebridgeModelConfig::saveValue('load_urls', 1);
}
return $rt;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:18,代码来源:url.php
示例14: fetchElement
public function fetchElement($name, $value, &$node, $control_name)
{
if (MagebridgeModelConfig::load('api_widgets') == true) {
$options = MageBridgeWidgetHelper::getWidgetData('theme');
if (!empty($options) && is_array($options)) {
array_unshift($options, array('value' => '', 'label' => '-- Select --'));
return JHTML::_('select.genericlist', $options, $name, null, 'value', 'label', $value);
} else {
MageBridgeModelDebug::getInstance()->warning('Unable to obtain MageBridge API Widget "theme": ' . var_export($options, true));
}
}
return '<input type="text" name="' . $name . '" value="' . $value . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:13,代码来源:theme.php
示例15: getInput
/**
* Method to get the output of this element
*
* @param null
* @return string
*/
protected function getInput()
{
$name = $this->name;
$fieldName = $this->fieldname;
$value = $this->value;
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$options = TemplatesHelper::getTemplateOptions(0);
if (!empty($options) && is_array($options)) {
array_unshift($options, array('value' => '', 'text' => ''));
return JHTML::_('select.genericlist', $options, $fieldName, null, 'value', 'text', MagebridgeModelConfig::load($fieldName));
}
return '<input type="text" name="' . $name . '" value="' . $value . '" />';
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:19,代码来源:template.php
示例16: getInput
/**
* Method to get the output of this element
*
* @param null
* @return string
*/
protected function getInput()
{
$name = $this->name;
$fieldName = $this->fieldname;
$value = $this->value;
if (MagebridgeModelConfig::load('api_widgets') == true) {
$options = MageBridgeWidgetHelper::getWidgetData('theme');
if (!empty($options) && is_array($options)) {
array_unshift($options, array('value' => '', 'label' => ''));
return JHTML::_('select.genericlist', $options, $name, null, 'value', 'label', MagebridgeModelConfig::load($fieldName));
}
}
return '<input type="text" name="' . $name . '" value="' . $value . '" />';
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:20,代码来源:theme.php
示例17: display
public function display($tpl = null)
{
// Load the bridge
$bridge = MageBridgeModelBridge::getInstance();
// Load the parameters
$layout = $this->getLayout();
$params = MageBridgeHelper::getParams();
// Set the request based upon the choosen category
$request = $params->get('request', false) ? $params->get('request') : MageBridgeUrlHelper::getRequest();
$prefix = preg_replace('/\\?(.*)/', '', $request);
$suffix = preg_replace('/(.*)\\?/', '', $request);
// Check if this a non-URL-optimized request
if (is_numeric($prefix)) {
$request = MageBridgeUrlHelper::getLayoutUrl($layout, $prefix);
} else {
// Determine the suffix
if ($layout == 'product') {
$suffix = $bridge->getMageConfig('catalog/seo/product_url_suffix');
} else {
if ($layout == 'category') {
$suffix = $bridge->getMageConfig('catalog/seo/category_url_suffix');
}
}
// Add the suffix, if this is set in the Magento configuration
if (!empty($suffix) && !preg_match('/' . $suffix . '$/', $request)) {
$request .= $suffix;
}
}
// Add the
$mode = $params->get('mode');
if (!empty($mode)) {
$request .= '?mode=' . $mode;
}
// Set the request in the bridge
$this->setRequest($request);
// Handle the redirect request
$redirect = JRequest::getString('redirect');
if (!empty($redirect)) {
$bridge->setHttpReferer($redirect);
}
// Reuse this request to set the Canonical URL
if (MagebridgeModelConfig::load('enable_canonical') == 1) {
$uri = MageBridgeUrlHelper::route($request);
$document = JFactory::getDocument();
$document->setMetaData('canonical', $uri);
}
// Set which block to display
$this->setBlock('content');
parent::display($tpl);
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:50,代码来源:view.html.php
示例18: getStore
/**
* Method to get the current store definition
*
* @param null
* @return array
*/
public function getStore()
{
// If the database configuration specified no stores, skip this step
if (MagebridgeModelConfig::load('load_stores') == 0) {
return null;
}
// Get the conditions
$db = JFactory::getDBO();
$db->setQuery("SELECT * FROM #__magebridge_stores WHERE `published`=1 ORDER BY `ordering`");
$conditions = $db->loadObjectList();
if (empty($conditions)) {
return null;
}
// Import the plugins
JPluginHelper::importPlugin('magebridgestore');
$plugins = JPluginHelper::getPlugin('magebridgestore');
// Try to match a condition with one of the connectors
foreach ($conditions as $condition) {
// Extract the parameters and make sure there's something to do
$actions = YireoHelper::toRegistry($condition->actions)->toArray();
// Detect the deprecated connector-architecture
if (!empty($condition->connector) && !empty($condition->connector_value)) {
JFactory::getApplication()->triggerEvent('onMageBridgeStoreConvertField', array($condition, &$actions));
}
// With empty actions, there is nothing to do
if (empty($actions)) {
continue;
}
// Loop through the plugins and validate the stored actions
foreach ($plugins as $plugin) {
$className = 'plg' . $plugin->type . $plugin->name;
if (class_exists($className)) {
$plugin = new $className($this, (array) $plugin);
// Validate the stored actions
if ($rt = $plugin->onMageBridgeValidate($actions, $condition)) {
// Construct the condition parameters
$name = $condition->name;
$type = $condition->type == 'storeview' ? 'store' : 'group';
// Check for the return value
if (is_array($rt)) {
return $rt;
}
// Return the store-configuration of this condition
return array('type' => $type, 'name' => $name);
}
}
}
}
return null;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:56,代码来源:store.php
示例19: authenticate
private function authenticate($auth)
{
if (!empty($auth) && !empty($auth['api_user']) && !empty($auth['api_key'])) {
$api_user = MageBridgeEncryptionHelper::decrypt($auth['api_user']);
$api_key = MageBridgeEncryptionHelper::decrypt($auth['api_key']);
if ($api_user != MagebridgeModelConfig::load('api_user')) {
MageBridgeModelDebug::getInstance()->error('XML-RPC plugin: API-authentication failed: Username did not match');
} elseif ($api_key != MagebridgeModelConfig::load('api_key')) {
MageBridgeModelDebug::getInstance()->error('XML-RPC plugin: API-authentication failed: Key did not match');
} else {
MageBridgeModelDebug::getInstance()->notice('XML-RPC plugin: API-authentication succeeded');
return true;
}
}
return false;
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:16,代码来源:default.xmlrpc.php
示例20: getSelectHTML
public function getSelectHTML($options)
{
$name = 'disable_css_mage';
$value = MageBridgeHelper::getDisableCss();
$current = MagebridgeModelConfig::load('disable_css_all');
if ($current == 1 || $current == 0) {
$disabled = ' disabled="disabled"';
} else {
$disabled = null;
}
if (!empty($options) && is_array($options)) {
array_unshift($options, array('value' => '', 'label' => '- ' . JText::_('None') . ' -'));
return JHTML::_('select.genericlist', $options, $name . '[]', 'multiple' . $disabled, 'value', 'label', $value);
}
return '<input type="text" name="' . $name . '" value="' . implode(',', $value) . '" />';
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:16,代码来源:stylesheets.php
注:本文中的MagebridgeModelConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论