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


PHP Project::getResponse方法代码示例

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


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

示例1: admin

 public static function admin($params)
 {
     $format = Utils::getFormat($params['args'], 0, 2);
     $app_url = Settings::getProtected('app_url');
     $db = Settings::getProtected('db');
     $user = User::getAuthenticatedUser();
     // Make sure the user is at least creator or admin
     RoleController::forceClearance(array('system.creator', 'system.admin'), $user);
     // Get latest work for the user's projects
     $latestWorkList = $db->getAdminProjectsLatestWork($user->username, 5);
     $latestWork = array();
     foreach ($latestWorkList as $work) {
         $qn = $work['queue_name'];
         $type = substr($qn, strpos($qn, '.') + 1, strpos($qn, ':') - strpos($qn, '.') - 1);
         $username = substr($qn, strpos($qn, ':') + 1);
         $item = new Item($work['item_id'], $work['project_slug']);
         $project = new Project($work['project_slug']);
         if ($item->project_type == 'system') {
             $transcriptURL = "{$app_url}/projects/" . $item->project_slug . "/items/" . $item->item_id . "/{$type}/{$username}";
             $editURL = "{$app_url}/projects/" . $item->project_slug . "/items/" . $item->item_id . "/edit";
         } else {
             $transcriptURL = "{$app_url}/" . $item->project_owner . "/projects/" . $item->project_slug . "/items/" . $item->item_id . "/{$type}/{$username}";
             $editURL = "{$app_url}/" . $item->project_owner . "/projects/" . $item->project_slug . "/items/" . $item->item_id . "/edit";
         }
         array_push($latestWork, array('item' => $item->getResponse(), 'project' => $project->getResponse(), 'type' => $type, 'username' => $username, 'date_completed' => $work['date_completed'], 'transcript_url' => $transcriptURL, 'edit_url' => $editURL));
     }
     $newestMembers = $db->getNewestProjectMembers($user->username, 5);
     // Only get list of users if they're a site admin
     $users = array();
     if ($user->role == 'admin') {
         $usernameList = $db->getUsers();
         foreach ($usernameList as $username) {
             $tempUser = new User($username['username']);
             $tempUserArray = $tempUser->getResponse();
             // Get list of projects they're working on
             $projects = $db->getUserProjectsWithStats($username['username']);
             $tempUserArray['projects'] = $projects;
             array_push($users, $tempUserArray);
         }
     }
     $response = array('page_title' => 'Admin Dashboard', 'user' => $user->getResponse(), 'latest_work' => $latestWork, 'newest_members' => $newestMembers, 'users' => $users);
     switch ($format) {
         case 'json':
             echo json_encode($response);
             break;
         case 'html':
             Template::render('admin_dashboard', $response);
             break;
     }
 }
开发者ID:hmmbug,项目名称:unbindery,代码行数:50,代码来源:AdminPageController.class.php

示例2: LogoutAction

 public function LogoutAction()
 {
     Project::getSecurityManager()->logout();
     Project::getResponse()->redirect(Project::getRequest()->createUrl(null, 'LoginForm'));
 }
开发者ID:amanai,项目名称:next24,代码行数:5,代码来源:AdminController.php

示例3: checkForUserBans

 public function checkForUserBans($user)
 {
     $banHistoryModel = new BanHistoryModel();
     $paramModel = new ParamModel();
     if ($user['banned'] || $banHistoryModel->isBanned($user['id'])) {
         // если забанен , проверить может уже все
         $t_ban_time_sec = $paramModel->getParam("UserController", "T_BAN_TIME_SEC");
         if (time() > $user['banned_date'] + $t_ban_time_sec) {
             $this->load($user['id']);
             $this->banned = 0;
             $this->save();
             $banHistoryModel->unban($user['id'], 1);
         } else {
             Project::getSecurityManager()->logout();
             Project::getResponse()->redirect(Project::getRequest()->createUrl('User', 'Login', null, false) . "/error:ban/login:" . $user['login']);
         }
     }
 }
开发者ID:amanai,项目名称:next24,代码行数:18,代码来源:UserModel.php

示例4: SocialVoteAddAction

 /**
  * Action: Оценка соц.позиции
  */
 public function SocialVoteAddAction()
 {
     $v_request = Project::getRequest();
     $v_sp_id = $v_request->getKeyByNumber(0);
     if ((int) $v_sp_id > 0) {
         $this->_SetVote($v_sp_id, $v_request->inp_criteria_id_1, $v_request->inp_select_1);
         $this->_SetVote($v_sp_id, $v_request->inp_criteria_id_2, $v_request->inp_select_2);
         $this->_SetVote($v_sp_id, $v_request->inp_criteria_id_3, $v_request->inp_select_3);
         // = Запись в таблицу локировки голосования
         $v_sp_votes_model = new SocialVotesModel();
         $v_sp_votes_model->social_pos_id = $v_sp_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', 'SocialView', array($v_sp_id)));
 }
开发者ID:amanai,项目名称:next24,代码行数:20,代码来源:SocialController.php

示例5: SaveSubjectAction

 public function SaveSubjectAction()
 {
     $request = Project::getRequest();
     $article_model = new ArticleModel();
     if (count($article_model->loadByParentId(0, array(ARTICLE_COMPETITION_STATUS::NEW_ARTICLE), Project::getUser()->getDbUser()->id)) < 5) {
         $article_model->title = $request->title;
         $article_model->articles_tree_id = $request->parent_id;
         $article_model->user_id = Project::getUser()->getDbUser()->id;
         $article_model->rate_status = ARTICLE_COMPETITION_STATUS::NEW_ARTICLE;
         $article_model->creation_date = date("Y-m-d H:i:s");
         $article_model->save();
     }
     Project::getResponse()->redirect($request->createUrl('Article', 'CompetitionCatalog'));
 }
开发者ID:amanai,项目名称:next24,代码行数:14,代码来源:ArticleController.php

示例6: CatalogDeleteTagAction

 function CatalogDeleteTagAction()
 {
     $request = Project::getRequest();
     $catalog_id = (int) $request->getKeyByNumber(0);
     $page_number = (int) $request->getKeyByNumber(1);
     $tag_page_number = (int) $request->getKeyByNumber(2);
     $tag_id = (int) $request->getKeyByNumber(3);
     $tag_model = new BlogTagModelSocieties();
     $tag_model->delete($tag_id);
     Project::getResponse()->redirect($request->createUrl('BlogAdminSocieties', 'CatalogEdit', array($catalog_id, $page_number, $tag_page_number)));
 }
开发者ID:amanai,项目名称:next24,代码行数:11,代码来源:BlogAdminSocietiesController.php

示例7: BookmarksImportMakeAction

 /**
  * Action: Импортирование закладок - процесс заливания
  */
 public function BookmarksImportMakeAction()
 {
     $v_request = Project::getRequest();
     $data = array();
     //$this->_BaseSiteData($data);
     $data['action'] = 'BookmarksImportMake';
     $data['import_make_url'] = $v_request->createUrl('Bookmarks', 'BookmarksImportMake');
     // Процесс обработки файла
     // Проверка на ошибку
     if ($_FILES['inp_file']['error'] == UPLOAD_ERR_FORM_SIZE) {
         $this->_view->addFlashMessage(FM::ERROR, "Размер загружаемого файла слишком велик.");
         $this->BookmarksImportFormAction();
         return;
     }
     if ($_FILES['inp_file']['error'] == 0 and $_FILES['inp_file']['size'] < self::C_MAX_FILE_UPLOAD_SIZE) {
         // Ошибок нет и размер в границах
         $v_return = $this->_ImportProcess($_FILES['inp_file']['tmp_name']);
         if ($v_return == 1) {
             $this->_view->addFlashMessage(FM::ERROR, "Загружаемый файл не является файлом закладок.");
             $this->BookmarksImportFormAction();
             return;
         }
         $this->BookmarksImportFormAction(true);
         return;
     }
     Project::getResponse()->redirect($v_request->createUrl('Bookmarks', 'BookmarksUser'));
 }
开发者ID:amanai,项目名称:next24,代码行数:30,代码来源:BookmarksController.php

示例8: SetCompetitionAction

 public function SetCompetitionAction()
 {
     $request = Project::getRequest();
     if ($request->sub == 0) {
         $id = (int) $request->getKeyByNumber(0);
         $article_tree_model = new ArticleTreeModel();
         $data['node'] = $article_tree_model->load($id);
         $this->_view->SetCompetition($data);
         $this->_view->ajax();
     } else {
         $article_comp_model = new ArticleCompetitionModel();
         $articleTreeId = (int) $request->article_tree_id;
         $dataBegin = $request->data_begin;
         $dataEnd = $request->data_end;
         $art = $article_comp_model->loadWhere($articleTreeId, $dataBegin, $dataEnd);
         var_dump($art);
         if (count($art) <= 0) {
             $article_comp_model->id_article_tree = (int) $request->id;
             $article_comp_model->data_begin = $dataBegin;
             $article_comp_model->data_end = $dataEnd;
             $article_comp_model->reward = $request->reward;
             $article_comp_model->save();
         }
         Project::getResponse()->redirect($request->createUrl('AdminArticle', 'ShowTree'));
     }
 }
开发者ID:amanai,项目名称:next24,代码行数:26,代码来源:AdminArticleController.php

示例9: DebateDelThemeAction

 public function DebateDelThemeAction()
 {
     $debateModel = new DebateModel();
     $request = Project::getRequest();
     $user = Project::getUser()->getDbUser();
     $isAdmin = $user->user_type_id == 1 ? true : false;
     $theme_id = $request->theme_id;
     $theme = $debateModel->getThemeById($theme_id);
     if ($theme && ($isAdmin || $theme['user_id'] == $user->id)) {
         $debateModel->deleteTheme($theme_id);
     }
     Project::getResponse()->redirect(Project::getRequest()->createUrl('Debate', 'Debate'));
 }
开发者ID:amanai,项目名称:next24,代码行数:13,代码来源:DebateController.php

示例10: checkOfficeAccess

 protected function checkOfficeAccess()
 {
     if (!Project::getUser()->isMyArea()) {
         Project::getResponse()->redirect(Project::getRequest()->createUrl("User", "Profile"));
     }
 }
开发者ID:amanai,项目名称:next24,代码行数:6,代码来源:SiteController.php

示例11: EditQuestionAction

 public function EditQuestionAction()
 {
     $request = Project::getRequest();
     $id = $request->getKeyByNumber(0);
     $data = array();
     if (!$request->getKeyByNumber(1)) {
         if ($id > 0) {
             $model = new QuestionModel();
             $cat_model = new QuestionCatModel();
             $tag_model = new QuestionTagModel();
             $data['question'] = $model->load($id);
             $data['cat_list'] = $cat_model->loadAll();
             $tags_model = new QuestionTagModel();
             $tags = $tags_model->loadWhere(null, null, $id);
             foreach ($tags as $tag) {
                 $data['tags'] .= $tag['name'] . ', ';
             }
             $data['tags'] = rtrim($data['tags'], ', ');
             $this->BaseAdminData();
             $this->_view->EditQuestion($data);
             $this->_view->ajax();
         }
     } else {
         if ($id > 0) {
             $model = new QuestionModel();
             $model->load($id);
             $model->q_text = $request->question_text;
             $model->questions_cat_id = (int) $request->cat_id;
             $id = $model->save();
             $tag_model = new QuestionTagModel();
             $question_tag_model = new QTagModel();
             $tags_ar = array();
             $tags_ar = explode(",", $request->tags);
             foreach ($tags_ar as $tag) {
                 $tag = trim($tag);
                 if (count($tag_model->loadByName($tag)) > 0) {
                     if (count($question_tag_model->loadWhere($id, $tag_model->id)) <= 0) {
                         $question_tag_model->question_id = $id;
                         $question_tag_model->question_tag_id = $tag_model->id;
                         $question_tag_model->save();
                         $question_tag_model->clear();
                     }
                 } else {
                     $tag_model->name = $tag;
                     $tag_id = $tag_model->save();
                     $tag_model->clear();
                     $question_tag_model->question_id = $id;
                     $question_tag_model->question_tag_id = $tag_id;
                     $question_tag_model->save();
                     $question_tag_model->clear();
                 }
             }
         }
         Project::getResponse()->Redirect($request->createUrl('AdminQuestionAnswer', 'QuestionList'));
     }
 }
开发者ID:amanai,项目名称:next24,代码行数:56,代码来源:AdminQuestionAnswerController.php

示例12: EditCommentAction

 public function EditCommentAction()
 {
     $request = Project::getRequest();
     $user = Project::getUser()->getDbUser();
     $isAdmin = $user->user_type_id == 1 ? true : false;
     $item_name = $request->item_name;
     switch ($item_name) {
         case 'article':
             $item_controller = 'Article';
             $item_action = 'ArticleView';
             break;
         case 'questions':
             $item_controller = 'QuestionAnswer';
             $item_action = 'ViewQuestion';
             break;
         case 'photo':
             $item_controller = 'Photo';
             $item_action = 'View';
             break;
         case 'bookmarks':
             $item_controller = 'Bookmarks';
             $item_action = 'BookmarksView';
             break;
         case 'social':
             $item_controller = 'Social';
             $item_action = 'SocialView';
             break;
         case 'blog':
             $item_controller = 'Blog';
             $item_action = 'Comments';
             break;
     }
     $comment_model = new CommentModel($item_name . '_comment', $item_name . '_id', $request->comment_id);
     if ($request->change_comment && ($isAdmin || $comment_model->user_id == $user->id)) {
         $warning_id = 0;
         if ($request->warning_text) {
             $warningModel = new WarningModel();
             $warning_id = $warningModel->add($comment_model->user_id, $request->warning_text);
         }
         $comment_model->editComment($comment_model->user_id, $warning_id, $request->editCommentArea, (int) $isAdmin);
     }
     Project::getResponse()->redirect($request->createUrl($item_controller, $item_action, array($request->element_id)));
 }
开发者ID:amanai,项目名称:next24,代码行数:43,代码来源:BaseCommentController.php

示例13: ActionDeleteAction

 function ActionDeleteAction()
 {
     if ($this->request->id) {
         $a = new ActionModel();
         $a->delete($this->request->id);
     }
     Project::getResponse()->redirect($this->request->createUrl('Dev', 'Actions', array('cid' => $this->request->cid)));
 }
开发者ID:amanai,项目名称:next24,代码行数:8,代码来源:DevController.php

示例14: addDesktopAction

 public function addDesktopAction()
 {
     $v_request = Project::getRequest();
     $v_session = Project::getSession();
     if ($v_request->action == 'change') {
         $userModel = new UserModel();
         $desktops = unserialize($userModel->getDesktops());
         $desktops[$v_request->d] = $v_request->vklad_name;
         $desktops = serialize($desktops);
         $userModel->addDesktop($desktops);
     } elseif ($v_request->action == 'del') {
         $userModel = new UserModel();
         $desktops = unserialize($userModel->getDesktops());
         unset($desktops[$v_request->d]);
         $desktops = serialize($desktops);
         $userModel->addDesktop($desktops);
     } else {
         $request_keys = $v_request->getKeys();
         $userModel = new UserModel();
         $desktops = unserialize($userModel->getDesktops());
         //$desktops[] = $v_request['tab_name'];
         $desktops[] = 'Новая вкладка';
         $desktops = serialize($desktops);
         $userModel->addDesktop($desktops);
     }
     if ($v_request->d) {
         Project::getResponse()->redirect(Project::getRequest()->createUrl("Index", "Index", array('d' => $v_request->d)));
     } else {
         Project::getResponse()->redirect(Project::getRequest()->createUrl("Index", "Index"));
     }
 }
开发者ID:amanai,项目名称:next24,代码行数:31,代码来源:IndexController.php

示例15: DeleteAction

 public function DeleteAction()
 {
     $request = Project::getRequest();
     $user_id = (int) Project::getUser()->getDbUser()->id;
     $question_model = new QuestionModel();
     $question_model->load($request->getKeyByNumber(0));
     if ($question_model->user_id == $user_id) {
         $question_model->delete($request->getKeyByNumber(0));
     }
     Project::getResponse()->redirect($request->createUrl('QuestionAnswer', 'UserQuestions'));
 }
开发者ID:amanai,项目名称:next24,代码行数:11,代码来源:QuestionAnswerController.php


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