本文整理汇总了PHP中CommonController::quickBarJsonInit方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::quickBarJsonInit方法的具体用法?PHP CommonController::quickBarJsonInit怎么用?PHP CommonController::quickBarJsonInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonController
的用法示例。
在下文中一共展示了CommonController::quickBarJsonInit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quickBarJson
/**
* 手机底部功能条
*/
public function quickBarJson()
{
$CommonCont = new CommonController();
$quickbar = $CommonCont->quickBarJsonInit();
$quickbar = json_decode($quickbar, true);
$quickbar = $quickbar['data'];
foreach ($quickbar as $key => $value) {
if ($value['type'] == "colors") {
$colors = $value['data'];
unset($quickbar[$key]);
break;
}
}
$config_str = file_get_contents(public_path('/templates/' . $this->themename) . '/config.ini');
$search = "/QuickBar=(.*)/i";
$searchtype = "/Type=(.*)/i";
$result = preg_match($search, $config_str, $config_arr);
if (!$result) {
$result = 1;
$config_arr = array();
$config_arr[1] = '#AAA,#BBB,#FFF|totop';
}
$lang = CustomerInfo::where('cus_id', $this->cus_id)->pluck('lang');
$templatesC = new TemplatesController();
$tempname = $templatesC->getTemplatesName($this->type);
$flagPlatform = substr($tempname, 0, 2);
$flagLanguage = substr($tempname, 2, 1);
$customerC = new CustomerController();
$domain = $customerC->getSwitchCustomer();
//双站用户
if (!empty($domain)) {
if ($flagPlatform == 'GM') {
//===手机===
$language_url = $domain['switch_mobile_domain'];
} elseif ($flagPlatform == 'GP') {
//===PC===
$language_url = $domain['switch_pc_domain'];
}
if ($flagLanguage == 9) {
//===英文===
$language = '中文版';
} elseif ($flagLanguage == 0) {
//===中文===
$language = 'English';
}
}
if ($result != 0) {
//===?===
if (trim($config_arr[1]) != "custom") {
//===非自定义===
$quickbar_arr = explode('|', $config_arr[1]);
$config['enable'] = true;
if ($this->type == 'pc') {
$config['type'] = 'p1';
} else {
if ($this->type == 'mobile') {
$config['type'] = 'm1';
} else {
$config['type'] = 'p1';
}
}
if ($lang == 'en') {
$config['language'] = 'en';
} else {
$config['language'] = 'cn';
}
$config['style'] = array();
if (!isset($colors[$this->type])) {
$tmpStyleConfigQuickbar = explode(',', $quickbar_arr[0]);
} else {
$tmpStyleConfigQuickbar = $colors[$this->type];
}
if (count($tmpStyleConfigQuickbar)) {
$keys = array('mainColor', 'secondColor', 'textColor', 'iconColor');
foreach ($tmpStyleConfigQuickbar as $key => $val) {
$arr = explode('|', $val);
$config['style'][$keys[$key]] = $arr[0];
}
if (!key_exists('iconColor', $config['style'])) {
$config['style']['iconColor'] = $config['style']['textColor'] ? $config['style']['textColor'] : '';
}
}
$config['module'] = array();
if (count($quickbar_arr) > 1) {
$tmpModulesConfigQuickbar = explode(',', trim($quickbar_arr[1]));
foreach ($tmpModulesConfigQuickbar as $key => $val) {
if ($val == 'tel') {
$tel = Customerinfo::where('cus_id', $this->cus_id)->pluck('telephone');
$config['module']['tel'] = $tel;
//数据库联系电话
} elseif ($val == 'totop') {
$config['module']['totop'] = 1;
}
}
} else {
$config['module'] = array();
}
//.........这里部分代码省略.........