mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:35:19 +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'),
|
'View Profile' => t('View Profile'),
|
||||||
'Photos' => t('Photos'),
|
'Photos' => t('Photos'),
|
||||||
'Events' => t('Events'),
|
'Events' => t('Events'),
|
||||||
|
'Tasks' => t('Tasks'),
|
||||||
'No Comment' => t('No Comment'),
|
'No Comment' => t('No Comment'),
|
||||||
'Directory' => t('Directory'),
|
'Directory' => t('Directory'),
|
||||||
'Help' => t('Help'),
|
'Help' => t('Help'),
|
||||||
|
|
|
@ -3,6 +3,7 @@ namespace Zotlabs\Module;
|
||||||
|
|
||||||
use App;
|
use App;
|
||||||
use Zotlabs\Web\Controller;
|
use Zotlabs\Web\Controller;
|
||||||
|
use Zotlabs\Lib\Apps;
|
||||||
|
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
|
|
||||||
|
@ -96,4 +97,19 @@ class Tasks extends Controller {
|
||||||
json_return_and_die($x);
|
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;
|
namespace Zotlabs\Widget;
|
||||||
|
|
||||||
|
use Zotlabs\Lib\Apps;
|
||||||
|
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
|
|
||||||
class Tasklist {
|
class Tasklist {
|
||||||
|
|
||||||
function widget($arr) {
|
function widget($arr) {
|
||||||
|
|
||||||
if (! local_channel())
|
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tasks'))) {
|
||||||
return;
|
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>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();}); }
|
$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