本文整理汇总了PHP中js类的典型用法代码示例。如果您正苦于以下问题:PHP js类的具体用法?PHP js怎么用?PHP js使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了js类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例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'));
}
$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
示例4: 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
示例5: 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
示例6: turnon
/**
* Turnon cron.
*
* @access public
* @return void
*/
public function turnon($confirm = 'no')
{
$turnon = empty($this->config->global->cron) ? 1 : 0;
if (!$turnon and $confirm == 'no') {
die(js::confirm($this->lang->cron->confirmTurnon, inlink('turnon', "confirm=yes")) . js::reload('parent'));
}
$this->loadModel('setting')->setItem('system.sys.common.global.cron', $turnon);
die(js::reload('parent'));
}
开发者ID:leowh,项目名称:colla,代码行数:15,代码来源:control.php
示例7: upload
public function upload($productID, $planID, $sprintID)
{
if (!empty($_FILES)) {
$msg = $this->importbugs->uploadExcel('', $productID, $planID, $sprintID);
echo "<script>alert('{$msg}')</script>";
// if(isonlybody()) die(js::closeModal('parent'));
die(js::closeModal('parent'));
}
$this->display();
}
开发者ID:XMGmen,项目名称:zentao,代码行数:10,代码来源:control.php
示例8: 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
示例9: editImage
public function editImage($userId)
{
if (!empty($_FILES)) {
$this->loadModel('myImage')->uploadImg();
if (isonlybody()) {
die(js::closeModal('parent'));
}
}
$file = $this->loadModel('myImage')->getFile($userId);
$this->view->file = $file;
$this->display();
}
开发者ID:XMGmen,项目名称:zentao,代码行数:12,代码来源:control.php
示例10: 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
示例11: manage
public function manage($productID)
{
if ($_POST) {
$this->branch->manage($productID);
die(js::reload('parent'));
}
$this->view->title = $this->lang->branch->manage;
$this->view->position[] = $this->lang->branch->manage;
$this->loadModel('product')->setMenu($this->product->getPairs('nocode'), $productID);
$this->view->product = $this->product->getById($productID);
$this->view->branches = $this->branch->getPairs($productID, 'noempty');
$this->display();
}
开发者ID:heeeello,项目名称:zentaopms,代码行数:13,代码来源:control.php
示例12: 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
示例13: delete
public function delete($type, $field)
{
$this->app->loadClass('infoextdao', $static = true);
$table = $this->config->custom->typeToTable[$type];
$sql_query = 'ALTER TABLE ' . infoextdao::backquote($table) . ' ' . "DROP COLUMN " . infoextdao::backquote($this->config->customFieldPrefix . $field);
try {
$result = $this->app->dbh->query($sql_query);
} catch (Exception $e) {
//echo 'Message: ' .$e->getMessage();
echo js::alert(addslashes($sql_query));
echo js::alert($this->lang->custom->alterTableFailed);
return false;
}
}
开发者ID:huokedu,项目名称:zentao,代码行数:14,代码来源:model.php
示例14: 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->title = $this->lang->admin->bind->caption;
$this->view->position[] = $this->lang->admin->bind->caption;
$this->view->sn = $this->config->global->sn;
$this->display();
}
开发者ID:fanscky,项目名称:HTPMS,代码行数:22,代码来源:control.php
示例15: 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
示例16: batchCreate
/**
* Create batch todo
*
* @access public
* @return void
*/
public function batchCreate()
{
$todos = fixer::input('post')->cleanInt('date')->get();
for ($i = 0; $i < $this->config->todo->batchCreate; $i++) {
if ($todos->names[$i] != '' || isset($todos->bugs[$i + 1]) || isset($todos->tasks[$i + 1])) {
$todo->account = $this->app->user->account;
if ($this->post->date == false) {
$todo->date = '2030-01-01';
} else {
$todo->date = $this->post->date;
}
$todo->type = $todos->types[$i];
$todo->pri = $todos->pris[$i];
$todo->name = isset($todos->names[$i]) ? $todos->names[$i] : '';
$todo->desc = $todos->descs[$i];
$todo->begin = $todos->begins[$i];
$todo->end = $todos->ends[$i];
$todo->status = "wait";
$todo->private = 0;
$todo->idvalue = 0;
if ($todo->type == 'bug') {
$todo->idvalue = isset($todos->bugs[$i + 1]) ? $todos->bugs[$i + 1] : 0;
}
if ($todo->type == 'task') {
$todo->idvalue = isset($todos->tasks[$i + 1]) ? $todos->tasks[$i + 1] : 0;
}
$this->dao->insert(TABLE_TODO)->data($todo)->autoCheck()->exec();
if (dao::isError()) {
echo js::error(dao::getError());
die(js::reload('parent'));
}
} else {
unset($todos->types[$i]);
unset($todos->pris[$i]);
unset($todos->names[$i]);
unset($todos->descs[$i]);
unset($todos->begins[$i]);
unset($todos->ends[$i]);
}
}
}
开发者ID:huokedu,项目名称:zentao,代码行数:47,代码来源:model.php
示例17: 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. */
$this->app->loadClass('pager', $static = true);
$pager = new pager(0, $this->config->forum->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->display();
}
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:30,代码来源:control.php
示例18: setMenu
/**
* Set menu.
*
* @param array $products
* @param int $productID
* @param string $extra
* @access public
* @return void
*/
public function setMenu($products, $productID, $extra = '')
{
/* Has access privilege?. */
if ($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID))) {
echo js::alert($this->lang->product->accessDenied);
die(js::locate('back'));
}
$currentModule = $this->app->getModuleName();
$currentMethod = $this->app->getMethodName();
/* init currentModule and currentMethod for report*/
if ($currentModule == 'story') {
$currentModule = 'product';
}
if ($currentMethod == 'report') {
$currentMethod = 'browse';
}
$selectHtml = $this->select($products, $productID, $currentModule, $currentMethod, $extra);
foreach ($this->lang->product->menu as $key => $menu) {
$replace = $key == 'list' ? $selectHtml : $productID;
common::setMenuVars($this->lang->product->menu, $key, $replace);
}
}
开发者ID:huokedu,项目名称:zentao,代码行数:31,代码来源:model.php
示例19: sync2db
public function sync2db($config)
{
$ldapUsers = $this->getUsers($config);
$user = new stdclass();
$account = '';
$i = 0;
for (; $i < $ldapUsers['count']; $i++) {
$user->account = $ldapUsers[$i][$config->uid][0];
$user->email = $ldapUsers[$i][$config->mail][0];
$user->realname = $ldapUsers[$i][$config->name][0];
$account = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($user->account)->fetch('account');
if ($account == $user->account) {
$this->dao->update(TABLE_USER)->data($user)->where('account')->eq($user->account)->autoCheck()->exec();
} else {
$this->dao->insert(TABLE_USER)->data($user)->autoCheck()->exec();
}
if (dao::isError()) {
echo js::error(dao::getError());
die(js::reload('parent'));
}
}
return $i;
}
开发者ID:TigerLau1985,项目名称:ZenTao_LDAP,代码行数:23,代码来源:model.php
示例20: create
/**
* Create an announce.
*
* @param int $categoryID
* @access public
* @return void
*/
public function create($categoryID = '')
{
$this->loadModel('article');
$categories = $this->loadModel('tree')->getOptionMenu('announce', 0, $removeRoot = true);
if (empty($categories)) {
die(js::locate($this->createLink('tree', 'redirect', "type=announce")));
}
if ($_POST) {
$announceID = $this->article->create('announce');
$actionID = $this->loadModel('action')->create('announce', $announceID, 'created');
$users = $this->loadModel('user')->getPairs('nodeleted,noclosed,noempty');
$this->loadModel('action')->sendNotice($actionID, array_keys($users), true);
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('announce', 'browse')));
}
unset($this->lang->announce->menu);
$this->view->title = $this->lang->announce->create;
$this->view->currentCategory = $categoryID;
$this->view->categories = $this->loadModel('tree')->getOptionMenu('announce', 0, $removeRoot = true);
$this->display();
}
开发者ID:leowh,项目名称:colla,代码行数:30,代码来源:control.php
注:本文中的js类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论