Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
merged branch 168-cachelists
- Loading branch information
Showing
52 changed files
with
2,557 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/*************************************************************************** | ||
* For license information see doc/license.txt | ||
* | ||
* Unicode Reminder メモ | ||
***************************************************************************/ | ||
|
||
require('./lib2/web.inc.php'); | ||
require_once('./lib2/logic/cachelist.class.php'); | ||
$tpl->name = 'addtolist'; | ||
$tpl->menuitem = MNU_CACHES_ADDTOLIST; | ||
|
||
$login->verify(); | ||
if ($login->userid == 0) | ||
$tpl->redirect_login(); | ||
|
||
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] + 0 : 0; | ||
if (!$cacheid) | ||
$tpl->redirect('index.php'); | ||
$tpl->assign('cacheid', $cacheid); | ||
|
||
if (isset($_REQUEST['cancel'])) | ||
$tpl->redirect('viewcache.php?cacheid=' . $cacheid); | ||
|
||
$newlist_name = isset($_REQUEST['newlist_name']) ? trim($_REQUEST['newlist_name']) : false; | ||
$newlist_public = isset($_REQUEST['newlist_public']); | ||
$newlist_watch = isset($_REQUEST['newlist_watch']); | ||
|
||
if (isset($_REQUEST['save']) && isset($_REQUEST['listid'])) | ||
{ | ||
$listid = $_REQUEST['listid'] + 0; | ||
if ($listid == 0) | ||
{ | ||
$cachelist = new cachelist(ID_NEW, $login->userid); | ||
if (!$cachelist->setName($newlist_name)) | ||
$tpl->assign('name_error', true); | ||
else | ||
{ | ||
$cachelist->setPublic($newlist_public); | ||
if ($cachelist->save()) | ||
{ | ||
$cachelist->addCacheByID($cacheid); | ||
if ($newlist_watch) | ||
$cachelist->watch(true); | ||
} | ||
$tpl->redirect('viewcache.php?cacheid=' . $cacheid); | ||
} | ||
} | ||
else | ||
{ | ||
$cachelist = new cachelist($listid); | ||
if ($cachelist->exist()) | ||
$cachelist->addCacheByID($cacheid); | ||
$tpl->redirect('viewcache.php?cacheid=' . $cacheid); | ||
} | ||
} | ||
|
||
$tpl->assign('cachename', sql_value("SELECT `name` FROM `caches` WHERE `cache_id`='&1'", '', $cacheid)); | ||
$tpl->assign('cachelists', cachelist::getMyLists()); | ||
$tpl->assign('default_list', cachelist::getMyLastAddedToListId()); | ||
$tpl->assign('newlist_name', $newlist_name); | ||
$tpl->assign('newlist_public', $newlist_public); | ||
$tpl->assign('newlist_watch', $newlist_watch); | ||
$tpl->display(); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/*************************************************************************** | ||
* For license information see doc/license.txt | ||
* | ||
* Unicode Reminder メモ | ||
* | ||
* Shortcut for cachelist search | ||
***************************************************************************/ | ||
|
||
require('./lib2/web.inc.php'); | ||
|
||
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] + 0 : 0; | ||
$watch = isset($_REQUEST['watch']); | ||
$dontwatch = isset($_REQUEST['dontwatch']); | ||
|
||
if ($id) | ||
{ | ||
if ($watch || $dontwatch) | ||
{ | ||
$list = new cachelist($id); | ||
if ($list->exist()) | ||
$list->watch($watch); | ||
} | ||
$tpl->redirect("search.php?searchto=searchbylist&listid=" . $id . "&showresult=1&f_disabled=0&f_inactive=0&f_ignored=1&sort=byname"); | ||
} | ||
else | ||
$tpl->redirect("cachelists.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/*************************************************************************** | ||
* For license information see doc/license.txt | ||
* | ||
* Unicode Reminder メモ | ||
***************************************************************************/ | ||
|
||
require('./lib2/web.inc.php'); | ||
require_once('./lib2/logic/cachelist.class.php'); | ||
require_once('./lib2/pager.class.php'); | ||
|
||
$login->verify(); | ||
|
||
$tpl->name = 'cachelists'; | ||
$tpl->menuitem = MNU_CACHES_LISTS; | ||
|
||
if (isset($_REQUEST['watchlist'])) | ||
{ | ||
$list = new cachelist($_REQUEST['watchlist'] + 0); | ||
if ($list->exist()) | ||
$list->watch(true); | ||
} | ||
else if (isset($_REQUEST['dontwatchlist'])) | ||
{ | ||
$list = new cachelist($_REQUEST['dontwatchlist'] + 0); | ||
if ($list->exist()) | ||
$list->watch(false); | ||
} | ||
|
||
$MAXITEMS = 30; | ||
$startat = isset($_REQUEST['startat']) ? $_REQUEST['startat']+0 : 0; | ||
$name_filter = isset($_REQUEST['name']) ? $_REQUEST['name'] : ''; | ||
$by_filter = isset($_REQUEST['by']) ? $_REQUEST['by'] : ''; | ||
$listcount = cachelist::getPublicListCount($name_filter, $by_filter); | ||
|
||
$tpl->assign('name_filter', $name_filter); | ||
$tpl->assign('by_filter', $by_filter); | ||
$tpl->assign('cachelists', cachelist::getPublicLists($startat, $MAXITEMS, $name_filter, $by_filter)); | ||
$tpl->assign('show_status', false); | ||
$tpl->assign('show_user', true); | ||
// Do not show watchers because this would allow conclusions on what the list owner watches. | ||
$tpl->assign('show_watchers', false); | ||
$tpl->assign('show_edit', false); | ||
$tpl->assign('togglewatch', 'cachelists.php'); | ||
|
||
$pager = new pager("cachelists.php?startat={offset}"); | ||
$pager->make_from_offset($startat, $listcount, $MAXITEMS); | ||
|
||
$tpl->display(); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.