当前位置: 首页>>代码示例>>PHP>>正文


PHP TabController::getSocialTabs方法代码示例

本文整理汇总了PHP中TabController::getSocialTabs方法的典型用法代码示例。如果您正苦于以下问题:PHP TabController::getSocialTabs方法的具体用法?PHP TabController::getSocialTabs怎么用?PHP TabController::getSocialTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TabController的用法示例。


在下文中一共展示了TabController::getSocialTabs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SocialPosAddAction

 /**
  *  Action: Открытие формы создания соц.позиции
  */
 public function SocialPosAddAction()
 {
     $v_request = Project::getRequest();
     $data = array();
     $data['action'] = 'SocialPosAdd';
     $v_current_userID = Project::getUser()->getDbUser()->id;
     // ID залогиненного пользователя
     $v_sp_model = new SocialModel();
     $data['arr_social_tree_criteria'] = $v_sp_model->loadTreeCriteria();
     $data['arr_categories'] = $v_sp_model->loadCategories();
     //$this->_BaseSiteData($data);
     if ($v_request->btn_submit == null) {
         // -- Открытие формы для создания
         $country_model = new CountryModel();
         $country_list = $country_model->loadAll();
         $this->_get_categories($data, $v_categoryID);
         $change_country_param = AjaxRequest::getJsonParam("Social", "ChangeCountry", array('#id#'));
         $this->_view->assign('country_list', $country_list);
         $this->_view->assign('change_country_param', $change_country_param);
         $this->_view->__set('product_places', $v_sp_model->getProductPlaces());
         $this->_view->assign('tab_list', TabController::getSocialTabs(false, false, false, true));
         // Show tabs
         $this->_view->Social_PosAdd($data);
         $this->_view->parse();
     } else {
         // -- Анализ данных и сохранение
         if ($v_request->inp_sp_name == "" or $v_request->inp_sp_comment == "") {
             // -- Данные неполные
             $data['inp_sp_name'] = $v_request->inp_sp_name;
             $data['inp_sp_comment'] = $v_request->inp_sp_comment;
             $this->_view->Social_PosAdd($data);
             $this->_view->addFlashMessage(FM::ERROR, 'Поля " * " должны быть заполнены');
             $this->_view->assign('tab_list', TabController::getSocialTabs(false, false, false, true));
             // Show tabs
             $this->_view->parse();
         } else {
             // -- Сохранение данных
             $v_model = new SocialModel();
             $v_model->social_tree_id = $v_request->inp_sp_category;
             $v_model->user_id = $v_current_userID;
             $v_model->name = $v_request->inp_sp_name;
             $v_model->creation_date = date("Y-m-d H:i:s");
             if ($v_request->type_prod) {
                 $v_model->id_product = $v_request->id_product;
             }
             if ($v_request->type_place) {
                 $country_model = new CountryModel();
                 $state_model = new StateModel();
                 $city_model = new CityModel();
                 $country = $country_model->getCountryNameById($v_request->country);
                 if ($country) {
                     $country .= ', ';
                 }
                 $state = $state_model->getStateNameById($v_request->select_social_state);
                 if ($state) {
                     $state .= ', ';
                 }
                 $city = $city_model->getCityNameById($v_request->select_social_city);
                 if ($city) {
                     $city .= ', ';
                 }
                 $street = $v_request->street;
                 if ($street) {
                     $street .= ', ';
                 }
                 $house = $v_request->house;
                 if ($house) {
                     $house .= ', ';
                 }
                 $address = urlencode($country . $state . $city . $street . $house);
                 //echo $address;
                 $Coords = file_get_contents('http://maps.google.com/maps/geo?q=' . $address . '&output=csv&key=ABQIAAAAIMN2iaCMFuGQ7iw1w3khQhRJcbERdBxj2ey4tItiMN02nh3_tBSPZ_cpbhowAtSVcVvvdpej4XMW1Q');
                 //home ABQIAAAAIMN2iaCMFuGQ7iw1w3khQhR-v9yHoD50evrZ-pbO1wgn-sHpRBTCwGDBW1h8fK3f31phKFZTanuxDA
                 //site ABQIAAAAIMN2iaCMFuGQ7iw1w3khQhRJcbERdBxj2ey4tItiMN02nh3_tBSPZ_cpbhowAtSVcVvvdpej4XMW1Q
                 list($status, $Zoom, $Xcoord, $Ycoord) = split(',', $Coords);
                 if ($status == 200) {
                     $v_model->Xcoord = $Xcoord;
                     $v_model->Ycoord = $Ycoord;
                     $v_model->Zoom = $Zoom;
                 }
             }
             $v_new_id = $v_model->save();
             // -- Сохранение коммента
             $v_comment_model = new SocialCommentModel();
             $v_comment_model->addComment(Project::getUser()->getDbUser()->id, 0, 0, $v_new_id, $v_request->inp_sp_comment, 0, 0);
             // -- Сохранения связи соц.позиции и критериев
             $this->_SetVote($v_new_id, $v_request->inp_num_criteria_1, $v_request->inp_select_1);
             $this->_SetVote($v_new_id, $v_request->inp_num_criteria_2, $v_request->inp_select_2);
             $this->_SetVote($v_new_id, $v_request->inp_num_criteria_3, $v_request->inp_select_3);
             // = Запись в таблицу локировки голосования
             $v_sp_votes_model = new SocialVotesModel();
             $v_sp_votes_model->social_pos_id = $v_new_id;
             $v_sp_votes_model->user_id = (int) Project::getUser()->getDbUser()->id;
             $v_sp_votes_model->ip = $_SERVER['REMOTE_ADDR'];
             $v_sp_votes_model->save();
             Project::getResponse()->redirect($v_request->createUrl('Social', 'SocialUserList'));
         }
//.........这里部分代码省略.........
开发者ID:amanai,项目名称:next24,代码行数:101,代码来源:SocialController.php


注:本文中的TabController::getSocialTabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。