Exemplo n.º 1
0
 /**
  * 保存推广信息
  * 
  */
 public function mobile_api()
 {
     $params = array("title" => $_POST["title"], "iosurl" => $_POST["ios_url"], "appdesc" => $_POST["appdesc"], "mobile_app_image" => $_POST["mobile_app_image"]);
     $webroot = explode("/", BIGAPP_ROOT);
     $plugin_name = $webroot[sizeof($webroot) - 1];
     $plugin_path = get_bloginfo('siteurl') . '/wp-content/plugins/' . $plugin_name . '/admin';
     $auth_info = BigAppAdminModel::get_bigapp_ak_info();
     $obj = new BkSvr($auth_info['ak'], $auth_info['sk'], 30);
     $appInfo = $obj->getInfo(BigAppConf::$appInfoUrl, array('method' => 'get_basic'));
     $app_id = isset($appInfo['app_id']) ? $appInfo['app_id'] : 0;
     $ret = $obj->getInfo(BigAppConf::$taskInfoUrl, array('app_id' => $app_id, 'method' => 'get_latest'), false);
     if (false !== $ret && isset($ret["data"])) {
         $params["icon_img"] = $ret["data"]["task_info"]["icon_image"];
         $params["appname"] = $ret["data"]["task_info"]["app_name"];
     }
     if ($params["icon_img"] == "") {
         $params["icon_img"] = $plugin_path . "/img/logo.png";
     }
     if ($params["appname"] == "") {
         $params["appname"] = "bigapp";
     }
     $params["pagetitle"] = $params["appname"] . $params["title"];
     //!< 每10分钟拉一次最新打包的配置
     $params["dateline"] = time() + 600;
     // 二维码链接生成短地址
     $bigapp_page_alias = BigAppConf::$page_alias;
     $downurl = get_bloginfo('siteurl') . '/?yz_app=1&api_route=admin_api&action=mobile_page&method=down';
     $params["downurl"] = bigapp_admin_api::createShortUrl($downurl);
     $pstr = json_encode($params);
     $svalue = str_replace("\\u", "#u", $pstr);
     update_option("bigapp_extend_setting", $svalue);
 }
Exemplo n.º 2
0
 /**
  * 生成插件的管理首页
  */
 public static function display_bigapp_admin_main_page()
 {
     //plugin base info
     $base_info = BigAppAdminModel::get_plugin_base_info();
     //菜单管理模块信息
     $menu_info = BigAppAdminModel::get_menu_info();
     $extend_info = BigAppAdminModel::get_extend_info();
     //导航管理模块信息
     //todo
     //校验信息,如果为array() 则需要展开校验,否则前端收缩校验区域
     $data['data']['verify_info'] = BigAppAdminModel::get_bigapp_ak_info();
     //公告
     $data['data']['common_info']['notice'] = BigAppAdminModel::get_notice_info();
     $data['data']['plugin_info'] = $base_info;
     $data['data']['menu_info'] = $menu_info;
     $data['data']['extend_info'] = $extend_info;
     $data['ajax_url']['opt_menu'] = get_bloginfo('siteurl') . "/?yz_app=1&api_route=admin_api&action=update_menu_switch";
     //设置菜单是否生效的url
     $data['ajax_url']['opt_verify'] = get_bloginfo('siteurl') . "/?yz_app=1&api_route=admin_api&action=update_verify_info";
     //设置验证信息
     show_debug($data, __FILE__, __LINE__);
     echo_output(bigapp_get_html('admin_main.tpl', $data));
     ?>
     <?php 
 }