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


PHP js::locate方法代码示例

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


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

示例1: board

 /**
  * The board page.
  * 
  * @param int    $boardID       the board id
  * @param string $mode
  * @param int    $pageID        the current page id
  * @access public
  * @return void
  */
 public function board($boardID = 0, $mode = '', $pageID = 1)
 {
     $board = $this->loadModel('tree')->getByID($boardID, 'forum');
     if (!$board) {
         die(js::locate('back'));
     }
     /* Build search form. */
     $this->loadModel('search', 'sys');
     $this->config->forum->search['actionURL'] = $this->createLink('forum', 'board', "boardID={$boardID}&mode=bysearch");
     $this->search->setSearchParams($this->config->forum->search);
     /* Get common threads. */
     $this->app->loadClass('pager', $static = true);
     $pager = new pager(0, 10, $pageID);
     if ($mode != 'bysearch') {
         $threads = $this->loadModel('thread')->getList($board->id, $orderBy = 'repliedDate_desc', $pager);
     }
     if ($mode == 'bysearch') {
         $threads = $this->loadModel('thread')->getBySearch($board->id, 'bysearch', $orderBy = 'repliedDate_desc', $pager);
     }
     $this->view->boardID = $boardID;
     $this->view->title = $board->name;
     $this->view->mode = $mode;
     $this->view->keywords = $board->keywords;
     $this->view->desc = strip_tags($board->desc);
     $this->view->board = $board;
     $this->view->boards = $this->forum->getBoards();
     $this->view->sticks = $this->thread->getSticks($board->id);
     $this->view->threads = $threads;
     $this->view->pager = $pager;
     $this->display();
 }
开发者ID:leowh,项目名称:colla,代码行数:40,代码来源:control.php

示例2: edit

 /**
  * Edit a reply.
  * 
  * @param string $replyID 
  * @access public
  * @return void
  */
 public function edit($replyID)
 {
     if ($this->app->user->account == 'guest') {
         die(js::locate($this->createLink('user', 'login')));
     }
     /* Judge current user has priviledge to edit the reply or not. */
     $reply = $this->reply->getByID($replyID);
     if (!$reply) {
         die(js::locate('back'));
     }
     $thread = $this->loadModel('thread')->getByID($reply->thread);
     if (!$this->thread->canManage($thread->board, $reply->author)) {
         die(js::locate('back'));
     }
     $this->thread->setEditor($thread->board, 'edit');
     if ($_POST) {
         $this->reply->update($replyID);
         if (dao::isError()) {
             $this->send(array('result' => 'fail', 'message' => dao::getError()));
         }
         $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('thread', 'view', "threaID={$thread->id}")));
     }
     $this->view->title = $this->lang->reply->edit . $this->lang->colon . $thread->title;
     $this->view->reply = $reply;
     $this->view->thread = $thread;
     $this->view->board = $this->loadModel('tree')->getById($thread->board);
     $this->view->boards = $this->loadModel('forum')->getBoards();
     $this->display();
 }
开发者ID:leowh,项目名称:colla,代码行数:36,代码来源:control.php

示例3: edit

 /**
  * Edit a reply.
  * 
  * @param string $replyID 
  * @access public
  * @return void
  */
 public function edit($replyID)
 {
     if ($this->app->user->account == 'guest') {
         die(js::locate($this->createLink('user', 'login')));
     }
     /* Judge current user has priviledge to edit the reply or not. */
     $reply = $this->reply->getByID($replyID);
     if (!$reply) {
         die(js::locate('back'));
     }
     $thread = $this->loadModel('thread')->getByID($reply->thread);
     if (!$this->thread->canManage($thread->board, $reply->author)) {
         die(js::locate('back'));
     }
     if ($this->thread->canManage($thread->board)) {
         $this->config->reply->editor->edit['tools'] = 'full';
     }
     if ($_POST) {
         /* If no captcha but is garbage, return the error info. */
         if ($this->post->captcha === false and $this->loadModel('captcha')->isEvil($_POST['content'])) {
             $this->send(array('result' => 'fail', 'reason' => 'needChecking', 'captcha' => $this->captcha->create4Thread()));
         }
         $this->reply->update($replyID);
         if (dao::isError()) {
             $this->send(array('result' => 'fail', 'message' => dao::getError()));
         }
         $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('thread', 'view', "threaID={$thread->id}")));
     }
     $this->view->title = $this->lang->reply->edit . $this->lang->colon . $thread->title;
     $this->view->reply = $reply;
     $this->view->thread = $thread;
     $this->view->board = $this->loadModel('tree')->getById($thread->board);
     $this->display();
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:41,代码来源:control.php

示例4: setMenu

 /**
  * Set menu.
  * 
  * @param  array  $projects 
  * @param  int    $projectID 
  * @param  string $extra
  * @access public
  * @return void
  */
 public function setMenu($projects, $projectID, $extra = '')
 {
     /* Check the privilege. */
     $project = $this->getById($projectID);
     /* Unset story, bug, build and testtask if type is ops. */
     if ($project and $project->type == 'ops') {
         unset($this->lang->project->menu->story);
         unset($this->lang->project->menu->bug);
         unset($this->lang->project->menu->build);
         unset($this->lang->project->menu->testtask);
     }
     if ($projects and !isset($projects[$projectID]) and !$this->checkPriv($project)) {
         echo js::alert($this->lang->project->accessDenied);
         die(js::locate('back'));
     }
     $moduleName = $this->app->getModuleName();
     $methodName = $this->app->getMethodName();
     if ($this->cookie->projectMode == 'noclosed' and $project->status == 'done') {
         setcookie('projectMode', 'all');
         $this->cookie->projectMode = 'all';
     }
     $selectHtml = $this->select($projects, $projectID, $moduleName, $methodName, $extra);
     foreach ($this->lang->project->menu as $key => $menu) {
         $replace = $key == 'list' ? $selectHtml : $projectID;
         common::setMenuVars($this->lang->project->menu, $key, $replace);
     }
 }
开发者ID:nanata1115,项目名称:zentaopms,代码行数:36,代码来源:model.php

示例5: board

 /**
  * The board page.
  * 
  * @param int    $boardID       the board id
  * @param int    $pageID        the current page id
  * @access public
  * @return void
  */
 public function board($boardID = 0, $pageID = 1)
 {
     $board = $this->loadModel('tree')->getByID($boardID, 'forum');
     if (!$board) {
         die(js::locate('back'));
     }
     if ($board->link) {
         helper::header301($board->link);
     }
     /* Get common threads. */
     $recPerPage = !empty($this->config->site->forumRec) ? $this->config->site->forumRec : $this->config->forum->recPerPage;
     $this->app->loadClass('pager', $static = true);
     $pager = new pager(0, $recPerPage, $pageID);
     $threads = $this->loadModel('thread')->getList($board->id, $orderBy = 'repliedDate_desc', $pager);
     $this->view->title = $board->name;
     $this->view->keywords = $board->keywords . '' . $this->config->site->keywords;
     $this->view->desc = strip_tags($board->desc);
     $this->view->board = $board;
     $this->view->sticks = $this->thread->getSticks($board->id);
     $this->view->threads = $threads;
     $this->view->pager = $pager;
     $this->view->mobileURL = helper::createLink('forum', 'board', "borderID={$boardID}&pageID={$pageID}", "category={$board->alias}", 'mhtml');
     $this->view->desktopURL = helper::createLink('forum', 'board', "borderID={$boardID}&pageID={$pageID}", "category={$board->alias}", 'html');
     $this->display();
 }
开发者ID:dyp8848,项目名称:chanzhieps,代码行数:33,代码来源:control.php

示例6: changePassword

 /**
  * Change password , if use default password ,go to change
  * 
  * @access public
  * @return void
  */
 public function changePassword()
 {
     if ($this->app->user->account == 'guest') {
         die(js::alert('guest') . js::locate('back'));
     }
     if (!empty($_POST)) {
         $password1 = $_POST['password1'];
         if (!$password1) {
             die(js::error('Please input password!'));
         }
         $isDefult = $this->dao->select('password')->from(TABLE_DEFAULTPASSWORD)->Where('password')->eq($this->post->password1)->fetchAll();
         //如果用户使用默认密码则跳到修改密码界面
         if ($isDefult) {
             die(js::error('Password can not in default list!') . js::locate($this->createLink('my', 'changePassword', 'type=forbidden'), 'parent'));
         }
         $this->user->updatePassword($this->app->user->id);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         die(js::locate($this->createLink('my', 'profile'), 'parent'));
     }
     $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->changePassword;
     $this->view->position[] = $this->lang->my->changePassword;
     $this->view->user = $this->user->getById($this->app->user->id);
     $this->display();
 }
开发者ID:xupnge1314,项目名称:project,代码行数:32,代码来源:changePassword.php

示例7: create

 /**
  * Create an article.
  * 
  * @access public
  * @return void
  */
 public function create()
 {
     if (!empty($_POST)) {
         $blogID = $this->blog->create();
         if (dao::isError()) {
             die(js::error(dao::getError()) . js::locate('back'));
         }
         die(js::locate(inlink('index')));
     }
     $this->view->title = $this->lang->blog->add;
     $this->display();
 }
开发者ID:take7yo,项目名称:zentaophp,代码行数:18,代码来源:control.php

示例8: test

 public function test()
 {
     $pubuConfig = $this->pubu->getConfig();
     $this->view->position[] = html::a(inlink('index'), $this->lang->pubu->common);
     $this->view->position[] = '测试';
     $ping = $this->pubu->sendNotification($pubuConfig->webhook, array('type' => 'ping', "data" => array("hello" => "zentao")));
     $this->view->ping = $ping;
     if (is_string($ping)) {
         echo js::alert($ping);
         die(js::locate('back'));
     }
     $this->display();
 }
开发者ID:pubuim,项目名称:pubuim-zentao-plugin,代码行数:13,代码来源:control.php

示例9: setConfig

 /**
  * Set configs of converter.
  *
  * This is the extrance of every system. It will call the set function of corresponding module.
  * 
  * @access public
  * @return void
  */
 public function setConfig()
 {
     if (!$this->post->source) {
         echo js::alert($this->lang->convert->mustSelectSource);
         die(js::locate('back'));
     }
     list($sourceName, $version) = explode('_', $this->post->source);
     $setFunc = "set{$sourceName}";
     $this->view->title = $this->lang->convert->setting;
     $this->view->source = $sourceName;
     $this->view->version = $version;
     $this->view->setting = $this->fetch('convert', $setFunc, "version={$version}");
     $this->display();
 }
开发者ID:laiello,项目名称:zentaoms,代码行数:22,代码来源:control.php

示例10: bind

 /**
  * Bind zentao.
  * 
  * @access public
  * @return void
  */
 public function bind()
 {
     if ($_POST) {
         $response = $this->admin->bindByAPI();
         if ($response == 'success') {
             $this->loadModel('setting')->setItem('system', 'common', 'global', 'community', $this->post->account);
             echo js::alert($this->lang->admin->bind->success);
             die(js::locate(inlink('index'), 'parent'));
         }
         die($response);
     }
     $this->view->sn = $this->loadModel('setting')->getItem('system', 'common', 'global', 'sn', 0);
     $this->display();
 }
开发者ID:huokedu,项目名称:zentao,代码行数:20,代码来源:control.php

示例11: setMenu

 /**
  * Set menu.
  * 
  * @param  array  $projects 
  * @param  int    $projectID 
  * @access public
  * @return void
  */
 public function setMenu($projects, $projectID)
 {
     /* Check the privilege. */
     if ($projects and !isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID))) {
         echo js::alert($this->lang->project->accessDenied);
         die(js::locate('back'));
     }
     $moduleName = $this->app->getModuleName();
     $methodName = $this->app->getMethodName();
     $selectHtml = $this->select($projects, $projectID, $moduleName, $methodName);
     foreach ($this->lang->project->menu as $key => $menu) {
         $replace = $key == 'list' ? $selectHtml : $projectID;
         common::setMenuVars($this->lang->project->menu, $key, $replace);
     }
 }
开发者ID:huokedu,项目名称:zentao,代码行数:23,代码来源:model.php

示例12: edit

 /**
  * Edit cron. 
  * 
  * @param  int    $cronID 
  * @access public
  * @return void
  */
 public function edit($cronID)
 {
     if ($_POST) {
         $this->cron->update($cronID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         die(js::locate(inlink('index'), 'parent'));
     }
     $this->view->title = $this->lang->cron->edit . $this->lang->cron->common;
     $this->view->position[] = html::a(inlink('index'), $this->lang->cron->common);
     $this->view->position[] = $this->lang->cron->edit;
     $this->view->cron = $this->cron->getById($cronID);
     $this->display();
 }
开发者ID:XMGmen,项目名称:zentao,代码行数:22,代码来源:control.php

示例13: create

 /**
  * Create a blog.
  * 
  * @param  int    $categoryID
  * @access public
  * @return void
  */
 public function create($categoryID = '')
 {
     $categories = $this->loadModel('tree')->getOptionMenu('blog', 0, $removeRoot = true);
     if (empty($categories)) {
         die(js::locate($this->createLink('tree', 'redirect', "type=blog")));
     }
     if ($_POST) {
         $this->article->create('blog');
         if (dao::isError()) {
             $this->send(array('result' => 'fail', 'message' => dao::getError()));
         }
         $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('team.blog')));
     }
     $this->view->title = $this->lang->blog->create;
     $this->view->currentCategory = $categoryID;
     $this->view->categories = $this->loadModel('tree')->getOptionMenu('blog', 0, $removeRoot = true);
     $this->view->type = 'blog';
     $this->display();
 }
开发者ID:leowh,项目名称:colla,代码行数:26,代码来源:control.php

示例14: getLibs

 public function getLibs($type = 'info')
 {
     if (!$this->app->dbh->query('show tables from `' . $this->config->db->name . '` where `Tables_in_' . $this->config->db->name . "`='" . $this->config->db->prefix . "info'")->fetch(PDO::FETCH_OBJ)->{'Tables_in_' . $this->config->db->name}) {
         echo js::alert('You Hava Delete All the Database Related To This Plugin!!!\\nPlease delete this plugin!');
         die(js::locate(helper::createLink('extension', 'browse'), 'parent'));
     }
     //此处有一个历史遗留问题,0.3版本以前的infolib库里无type列
     $test = $this->app->dbh->query('desc ' . TABLE_INFOLIB . ' type')->fetch(PDO::FETCH_OBJ);
     //print $test->Field.'<br />';
     if (!$test->Field) {
         $infolibs = $this->dao->select('id, name')->from(TABLE_INFOLIB)->where('deleted')->eq(0)->fetchPairs();
         //echo js::alert($this->lang->info->pleaseUpgrade);
     } else {
         $infolibs = $this->dao->select('id, name')->from(TABLE_INFOLIB)->where('deleted')->eq(0)->andWhere('type')->eq($type)->fetchPairs();
     }
     //		while (list($key, $val) = each($test)) {
     //			echo "$key => $val\n";
     //		}
     return $infolibs;
 }
开发者ID:huokedu,项目名称:zentao,代码行数:20,代码来源:model.php

示例15: buildQuery

 /**
  * Build query
  * 
  * @access public
  * @return void
  */
 public function buildQuery($queryID = '')
 {
     if ($queryID) {
         $query = $this->search->getQuery($queryID);
         if ($query) {
             $this->session->set($query->module . 'Query', $query->sql);
             $this->session->set($query->module . 'Form', $query->form);
             $this->session->set('queryID', $queryID);
             if (!empty($query->form['actionURL'])) {
                 die(js::locate($query->form['actionURL']));
             } else {
                 die(js::locate('back'));
             }
         } else {
             die(js::locate('back'));
         }
     }
     $this->search->buildQuery();
     die(js::locate($this->post->actionURL, 'parent'));
 }
开发者ID:leowh,项目名称:colla,代码行数:26,代码来源:control.php


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