mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:15:15 +00:00
turn tasks into an app
This commit is contained in:
parent
a2a7a22c38
commit
1933d0f3dd
4 changed files with 28 additions and 2 deletions
|
@ -341,6 +341,7 @@ class Apps {
|
|||
'View Profile' => t('View Profile'),
|
||||
'Photos' => t('Photos'),
|
||||
'Events' => t('Events'),
|
||||
'Tasks' => t('Tasks'),
|
||||
'No Comment' => t('No Comment'),
|
||||
'Directory' => t('Directory'),
|
||||
'Help' => t('Help'),
|
||||
|
|
|
@ -3,6 +3,7 @@ namespace Zotlabs\Module;
|
|||
|
||||
use App;
|
||||
use Zotlabs\Web\Controller;
|
||||
use Zotlabs\Lib\Apps;
|
||||
|
||||
require_once('include/event.php');
|
||||
|
||||
|
@ -96,4 +97,19 @@ class Tasks extends Controller {
|
|||
json_return_and_die($x);
|
||||
}
|
||||
}
|
||||
|
||||
function get() {
|
||||
$desc = t('This app provides a simple personal and task list.');
|
||||
|
||||
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
||||
|
||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tasks'))) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$obj = new \Zotlabs\Widget\Tasklist;
|
||||
return $obj->widget([]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,14 +2,17 @@
|
|||
|
||||
namespace Zotlabs\Widget;
|
||||
|
||||
use Zotlabs\Lib\Apps;
|
||||
|
||||
require_once('include/event.php');
|
||||
|
||||
class Tasklist {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
if (! local_channel())
|
||||
return;
|
||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tasks'))) {
|
||||
return EMPTY_STR;
|
||||
}
|
||||
|
||||
$o .= '<script>var tasksShowAll = 0; $(document).ready(function() { tasksFetch(); $("#tasklist-new-form").submit(function(event) { event.preventDefault(); $.post( "tasks/new", $("#tasklist-new-form").serialize(), function(data) { tasksFetch(); $("#tasklist-new-summary").val(""); } ); return false; } )});</script>';
|
||||
$o .= '<script>function taskComplete(id) { $.post("tasks/complete/"+id, function(data) { tasksFetch();}); }
|
||||
|
|
6
app/tasks.apd
Normal file
6
app/tasks.apd
Normal file
|
@ -0,0 +1,6 @@
|
|||
version: 1
|
||||
url: $baseurl/tasks
|
||||
requires: local_channel
|
||||
name: Tasks
|
||||
photo: icon:list
|
||||
categories: Productivity
|
Loading…
Reference in a new issue