本文整理汇总了PHP中JRequest::GetCmd方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::GetCmd方法的具体用法?PHP JRequest::GetCmd怎么用?PHP JRequest::GetCmd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::GetCmd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateAddonsJs
protected function generateAddonsJs() {
header('Content-Type: text/javascript');
$type = JRequest::GetCmd('addontype');
$db = oseDB::instance();
$user = JFactory::getUser();
$array = array();
$output = '';
if ($type == 'registerOS') {
$headerObjs = oseMscAddon::getAddonList('registerOS_header', false, null, 'obj');
$bodyObjs = oseMscAddon::getAddonList('registerOS_body', false, null, 'obj');
$footerObjs = oseMscAddon::getAddonList('registerOS_footer', false, null, 'obj');
if ($user->guest) {
$headerObjs = $this->filter($headerObjs, array('welcome', 'login'), false);
} else {
$headerObjs = $this->filter($headerObjs, array('login'), false);
$bodyObjs = $this->filter($bodyObjs, array('juser', 'juser_e', 'mailing', 'jomsocial'), false);
}
$array['header'] = $headerObjs;
$array['body'] = $bodyObjs;
$array['footer'] = $footerObjs;
$formItems = array();
foreach ($array as $a) {
foreach ($a as $obj) {
if (!empty($obj->addon_name)) {
$formItems[] = array('xtype' => $obj->name);
}
}
}
$output .= "var getFormItems = function() {return " . oseJson::encode($formItems) . "};";
$output .= "\r\n";
} elseif ($type == 'member') {
$user = JFactory::getUser();
$member = oseRegistry::call('member');
$view = $member->getInstance('PanelView');
$member->instance($user->id);
$result = $member->getMemberPanelView('Member', 'member_user');
$columns = array();
$columns[] = array('type' => 'user', 'title' => JText::_('MEMBER_USER_ACCOUNT'));
if (oseObject::getValue($result, 'tpl', false)) {
switch ($result['tpl']) {
case ('master'):
case ('expired'):
$columns[] = array('type' => 'billing', 'title' => JText::_('BILLING_INFORMATION'));
;
$columns[] = array('type' => 'msc', 'title' => JText::_('MY_MEMBERSHIP'));
;
break;
default:
$columns[] = 'billing';
break;
}
}
$output .= "var getMemTypes = function() {return " . oseJson::encode($columns) . "};";
$output .= "\r\n";
foreach ($columns as $column) {
$result = $member->getMemberPanelView('Member', 'member_' . $column['type']);
$array[$column['type']] = array_values($result['addons']);
}
}
$output .= "var getAddons = function() {return " . oseJson::encode($array) . "};";
return $output;
}