本文整理汇总了PHP中oseRegistry::register方法的典型用法代码示例。如果您正苦于以下问题:PHP oseRegistry::register方法的具体用法?PHP oseRegistry::register怎么用?PHP oseRegistry::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oseRegistry
的用法示例。
在下文中一共展示了oseRegistry::register方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
oseRegistry::register('registry', 'oseregistry');
oseRegistry::call('registry');
oseRegistry::register('msc', 'membership');
$this->msc = oseRegistry::call('msc');
oseRegistry::register('user', 'user');
oseRegistry::quickRequire('user');
oseRegistry::register('member', 'member');
oseRegistry::call('member');
oseRegistry::register('payment', 'payment');
oseRegistry::quickRequire('payment');
JFactory::getApplication('administrator');
}
示例2: fetchElement
function fetchElement($name, $value, &$node, $control_name) {
require_once(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ose_cpu' . DS . 'define.php');
require_once(OSECPU_B_PATH . DS . 'oseregistry' . DS . 'oseregistry.php');
oseRegistry::register('registry', 'oseregistry');
oseRegistry::call('registry');
oseRegistry::register('msc', 'membership');
oseRegistry::call('msc', 'membership');
$objs = oseMscTree::getSubTreeDepth(0, 0, 'obj');
$option = array();
$option[] = '<option value ="">N/A</option>';
foreach ($objs as $obj) {
@$option[] = JHTML::_('select.option', $obj->id, $obj->title);
}
$return = JHTML::_('select.genericlist', $option, '' . $control_name . '[' . $name . '][]', ' class="inputbox" style="width:90%;" multiple="multiple" size="15"','value', 'text', $value);
return $return;
}
示例3: getInput
protected function getInput() {
require_once(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ose_cpu' . DS . 'define.php');
require_once(OSECPU_B_PATH . DS . 'oseregistry' . DS . 'oseregistry.php');
oseRegistry::register('registry', 'oseregistry');
oseRegistry::call('registry');
oseRegistry::register('msc', 'membership');
oseRegistry::call('msc', 'membership');
$objs = oseMscTree::getSubTreeDepth(0, 0, 'obj');
$option = array();
foreach ($objs as $obj) {
if ($obj->published) {
@$option[] = JHTML::_('select.option', $obj->id, $obj->title);
}
}
$name = "{$this->name}[]";
return JHTML::_('select.genericlist', $option, $name, ' class="inputbox" style="width:90%;" multiple="multiple" size="15"', 'value', 'text', $this->value);
}
示例4: getInput
protected function getInput()
{
$name = 'msc_ids';
$control_name = "jform[params][msc_ids][]";
require_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ose_cpu'.DS.'define.php');
require_once( OSECPU_B_PATH.DS.'oseregistry'.DS.'oseregistry.php');
oseRegistry::register('registry','oseregistry');
oseRegistry::call('registry');
//oseExit($value);
oseRegistry::register('msc','membership');
oseRegistry::call('msc','membership');
$objs = oseMscTree::getSubTreeDepth(0,0,'obj');
$option = array();
$return = '<select class="inputbox" style="width:90%;" multiple="multiple" size="15" name = "'.$control_name.'">';
if (!is_array($this->value))
{
$this->value = array($this->value);
}
foreach ( $objs as $obj )
{
if($obj->published)
{
if (in_array($obj->id, $this->value))
{
$selected = "selected";
}
else
{
$selected = "";
}
$return .= "<option value ='$obj->id' $selected>".$obj->title ."</option>";
}
}
$return .="</select>";
return $return;
}
示例5: cancel
function cancel($id, $entry_type = 'msc', $entry_option = null)
{
oseRegistry::register('email', 'email');
oseRegistry::register('msc', 'membership');
oseRegistry::register('user', 'user');
oseRegistry::quickRequire('user');
oseRegistry::register('member', 'member');
$msc_id = $id;
$user_id = $this->user_id;
$db = oseDB::instance();
$query = " SELECT * FROM `#__osemsc_member` WHERE `msc_id` = '{$msc_id}' AND `member_id` = '{$user_id}'";
$db->setQuery($query);
$memInfo = oseDB::loadItem('obj');
$memParams = oseJson::decode($memInfo->params);
$order_id = oseGetValue($memParams, 'order_id');
$order_item_id = oseGetValue($memParams, 'order_item_id');
$params = oseCall('member')->getAddonParams($msc_id, $user_id, $order_id, array('order_item_id' => $order_item_id));
$msc = oseCall('msc');
$app = JFactory::getApplication('SITE');
$controller = JRequest::getCmd('controller');
if ($app->isSite()) {
$updated = oseMscAddon::runAction('member.msc.cancelMsc', $params, true, false);
} elseif ($controller == 'orders') {
$updated = oseMscAddon::runAction('member.msc.cancelMsc', $params, true, false);
} else {
$updated = oseMscAddon::runAction('member.msc.cancelMsc', $params, true, true);
}
return $updated;
}
示例6: cancel
public static function cancel($params)
{
$result = array();
$result['success'] = true;
if(empty($params['allow_work']))
{
$result['success'] = false;
$result['title'] = 'Error';
$result['content'] = JText::_("Error");
return $result;
}
unset($params['allow_work']);
$member_id = $params['member_id'];
$msc_id = $params['msc_id'];
$user = JFactory::getUser($member_id);
$db = oseDB::instance();
$query = "SELECT * FROM `#__osemsc_member`"
." WHERE `msc_id` = '{$msc_id}' AND `member_id` = '{$member_id}'"
;
$db->setQuery($query);
$memInfo = oseDB::loadItem('obj');
$memParams = oseJson::decode($memInfo->params,true);
$order_id = $memParams['order_id'];
$order_item_id = $memParams['order_item_id'];
$query = " SELECT * FROM `#__osemsc_order`"
." WHERE `order_id` = '{$order_id}'"
;
$db->setQuery($query);
$order = oseDB::loadItem('obj');
$oParams = oseJson::decode($order->params);
//$msc_option = oseObject::getValue($oParams,'msc_option');
$query = " SELECT * FROM `#__osemsc_order_item`"
." WHERE `order_id` = '{$order_id}'"
;
$db->setQuery($query);
$order_item = oseDB::loadItem('obj');
$iParams = oseJson::decode($order_item->params);
$msc_option = $iParams->msc_option;
if(oseGetValue($oParams,'isLicensee',0))
{
$result['success'] = true;
$result['title'] = JText::_('Done');
$result['content'] = JText::_("Done");
return $result;
}
$query = " SELECT * FROM `#__osemsc_ext`"
." WHERE `id` = '{$msc_id}' AND `type` = 'oselic'"
;
$db->setQuery($query);
$data = oseDB::loadItem('obj');
$data = oseJson::decode($data->params);
$data = oseObject::getValue($data,$msc_option,array());
if( oseObject::getValue($data,'enable_license') )
{
oseRegistry :: register('user2', 'user2');
oseRegistry :: register('lic', 'lic');
oseRegistry :: register('email', 'email');
oseRegistry :: register('locale', 'locale');
$user = oseCall('user2')->instance( $member_id,'lic');
$query = " SELECT * FROM `#__oselic_type_license_key`"
." WHERE `license_id` = '{$oParams->license_id}' AND `licensee_id` > 0"
;
$db->setQuery($query);
$licenseKeys = oseDB::loadList('obj');
foreach($licenseKeys as $licenseKey)
{
if(!empty($licenseKey->licensee_id))
{
switch($licenseKey->app)
{
case('msc'):
//version
oseAppConfig::load( 'mscv6' );
break;
default:
oseAppConfig::load($licenseKey->app);
break;
}
$user = oseCall('user2')->instance($licenseKey->licensee_id,$licenseKey->app);
$user->cancel($licenseKey->entry_id,$licenseKey->app);
}
else
{
continue;
}
}
// delete license info
oseDB::delete('#__oselic_type_license_key',array('license_id'=>$oParams->license_id));
//.........这里部分代码省略.........
示例7: load
public static function load($app, $config = array())
{
oseRegistry::register('registry', 'oseregistry');
oseRegistry::call('registry');
switch ($app) {
case 'msc':
case 'mscv5':
case 'msc1v5':
oseRegistry::register('remote', 'remote');
oseRegistry::register('email', 'email');
oseRegistry::register('msc', 'membership');
oseRegistry::register('user', 'user');
oseRegistry::quickRequire('user');
oseRegistry::register('member', 'member');
// default
oseRegistry::register('payment', 'payment');
oseRegistry::quickRequire('payment');
oseRegistry::register('content', 'content');
break;
case 'mscv6':
oseRegistry::register('form', 'form');
oseAppConfig::load('payment');
oseRegistry::quickRequire('payment2');
oseRegistry::register('payment2', 'paymentMsc');
oseRegistry::register('msc', 'msc');
oseRegistry::register('content', 'content');
break;
case 'credit':
oseAppConfig::load('payment');
oseRegistry::register('form', 'form');
oseRegistry::quickRequire('payment2');
oseRegistry::register('payment2', 'paymentCredit');
oseRegistry::register('credit', 'credit');
oseRegistry::register('content2', 'content2');
break;
case 'ecash':
oseAppConfig::load('payment');
oseRegistry::quickRequire('payment2');
oseRegistry::register('payment2', 'paymentEcash');
break;
case 'contract':
oseRegistry::register('form', 'form');
oseRegistry::register('contract', 'contract');
oseRegistry::register('payment2', 'paymentContract');
break;
case 'ftable':
oseRegistry::register('ftable', 'ftable');
break;
case 'mart':
self::load('mscv6');
self::load('contract');
self::load('lic');
oseRegistry::register('form', 'form');
oseRegistry::register('mart', 'mart');
oseRegistry::register('payment2', 'paymentMart');
break;
case 'commerce':
case 'payment':
oseRegistry::register('remote', 'remote');
oseRegistry::register('email', 'email');
oseRegistry::register('user2', 'user2');
oseRegistry::quickRequire('user2');
oseRegistry::register('locale', 'locale');
oseRegistry::register('form', 'form');
oseRegistry::register('event', 'event');
oseRegistry::register('payment2', 'payment2');
oseRegistry::quickRequire('payment2');
break;
case 'lic':
case 'license':
oseAppConfig::load('payment');
oseRegistry::quickRequire('payment2');
oseRegistry::register('payment2', 'paymentLic');
oseRegistry::register('lic', 'lic');
oseRegistry::register('form', 'form');
break;
case 'migration':
oseRegistry::register('user2', 'user2');
oseRegistry::quickRequire('user2');
self::load('mscv6');
break;
default:
oseRegistry::register('user', 'user');
break;
}
}
示例8: getLicCS
public static function getLicCS($params = array())
{
oseRegistry::register('lic', 'license');
$lic = oseRegistry::call('lic');
$items = $lic->getLicList('CS');
$result = array();
if (count($items) < 1) {
$result['total'] = 0;
$result['results'] = '';
} else {
$result['total'] = count($items);
$result['results'] = $items;
}
return $result;
}
示例9:
oseRegistry::quickRequire('member');
if (!empty($config->customized_member_mode)) {
oseRegistry::register('member', $config->customized_member_mode);
}
} else {
$config->member_mode = (isset($config->member_mode)) ? $config->member_mode : '';
switch ($config->member_mode) {
case ('multi'):
oseRegistry::call('member');
break;
default:
oseRegistry::call('member');
break;
}
}
oseRegistry::register('payment', 'payment');
oseRegistry::quickRequire('payment');
if (empty($config->payment_system)) {
$config->register_form = (isset($config->register_form)) ? $config->register_form : 'onestep';
if ($config->register_form == 'default' || empty($config->register_form)) {
oseRegistry::register('payment', 'paymentSC');
}
} else {
oseRegistry::register('payment', 'payment' . $config->payment_system);
}
oseRegistry::register('remote', 'remote');
oseRegistry::register('lic', 'license');
oseRegistry::register('content', 'content');
oseRegistry::register('debug', 'debug');
oseRegistry::quickRequire('debug');
?>
示例10: renew
public static function renew($params)
{
$result = array();
$result = array();
$result['success'] = true;
if(empty($params['allow_work']))
{
$result['success'] = false;
$result['title'] = 'Error';
$result['content'] = JText::_("Error");
return $result;
}
unset($params['allow_work']);
//oseExit($params);
$db = oseDB::instance();
$post = JRequest::get('post');
$msc_id = $params['msc_id'];
$member_id = $params['member_id'];
$order_id = $params['order_id'];
$order_item_id = $params['order_item_id'];
if(empty($msc_id))
{
$result['success'] = false;
$result['title'] = 'Error';
$result['content'] = JText::_("Renew Msc: No Msc ID");
return $result;
}
$query = " SELECT * FROM `#__osemsc_order`"
." WHERE `order_id` = '{$order_id}'"
;
$db->setQuery($query);
$order = oseDB::loadItem('obj');
$oParams = oseJson::decode($order->params);
//$msc_option = oseObject::getValue($oParams,'msc_option');
$query = " SELECT * FROM `#__osemsc_order_item`"
." WHERE `order_id` = '{$order_id}'"
;
$db->setQuery($query);
$order_item = oseDB::loadItem('obj');
$iParams = oseJson::decode($order_item->params);
$msc_option = $iParams->msc_option;
if(oseGetValue($oParams,'isLicensee',0))
{
$result['success'] = true;
$result['title'] = JText::_('Done');
$result['content'] = JText::_("Done");
return $result;
}
$query = " SELECT * FROM `#__osemsc_ext`"
." WHERE `id` = '{$msc_id}' AND `type` = 'oselic'"
;
$db->setQuery($query);
$data = oseDB::loadItem('obj');
$data = oseJson::decode($data->params);
$data = oseObject::getValue($data,$msc_option,array());
if( oseObject::getValue($data,'enable_license') )
{
oseRegistry :: register('user2', 'user2');
oseRegistry :: register('lic', 'lic');
oseRegistry :: register('email', 'email');
oseRegistry :: register('locale', 'locale');
$user = oseCall('user2')->instance( $member_id,'lic');
$user->join( $data->license_id );
$query = " SELECT * FROM `#__oselic_type_license`"
." WHERE `user_id` = '{$member_id}'"
." ORDER BY `id` DESC"
." LIMIT 1"
;
$db->setQuery($query);
$license = oseDB::loadItem('obj');
$oParams->license_id = $license->id;
$vals = array();
$vals['order_id'] = $order_id;
$vals['params'] = oseJson::encode($oParams);
oseDB::update('#__osemsc_order','order_id',$vals);
if( oseObject::getValue($data,'member_expiry_mode') == 1 )
{
$query = " SELECT * FROM `#__osemsc_member`"
." WHERE `msc_id` = '{$msc_id}' AND `member_id` = '{$member_id}'"
;
$db->setQuery($query);
$memInfo = oseDB::loadItem('obj');
$vals = array();
$vals['id'] = $license->id;
$vals['expiry_date'] = $memInfo->expired_date;
//.........这里部分代码省略.........