diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-17 12:00:58 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-17 12:00:58 -0300 |
commit | 228d3697bcd0218605be2e28131574cc85293a2e (patch) | |
tree | 6a59c627f6226bd2b3056b959acc9cc871eb1f8f /views/default/forms | |
download | elgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.gz elgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.bz2 |
Squashed 'mod/tasks/' content from commit c9b1097
git-subtree-dir: mod/tasks
git-subtree-split: c9b1097ce081d6893f9c939146208559c089dc15
Diffstat (limited to 'views/default/forms')
-rw-r--r-- | views/default/forms/tasks/comments/add.php | 45 | ||||
-rw-r--r-- | views/default/forms/tasks/edit.php | 63 | ||||
-rw-r--r-- | views/default/forms/tasks/inline.php | 35 |
3 files changed, 143 insertions, 0 deletions
diff --git a/views/default/forms/tasks/comments/add.php b/views/default/forms/tasks/comments/add.php new file mode 100644 index 000000000..ddbca14f5 --- /dev/null +++ b/views/default/forms/tasks/comments/add.php @@ -0,0 +1,45 @@ +<?php +/** + * Tasks comments add form + * + * @package ElggTasks + * + * @uses ElggEntity $vars['entity'] The entity to comment on + * @uses bool $vars['inline'] Show a single line version of the form? + */ + +elgg_load_library('elgg:tasks'); + +if (isset($vars['entity']) && elgg_is_logged_in()) { + + $inline = elgg_extract('inline', $vars, false); + + if ($inline) { + echo elgg_view('input/text', array('name' => 'generic_comment')); + echo elgg_view('input/submit', array('value' => elgg_echo('comment'))); + } else { +?> + <div> + <label><?php echo elgg_echo("generic_comments:add"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> + <br /><label><?php echo elgg_echo('tasks:state:actions'); ?></label> + <?php + echo elgg_view('input/radio', array( + 'name' => 'state_action', + 'options' => tasks_prepare_radio_options($vars['entity']), + )); + ?> + </div> + <div class="elgg-foot"> +<?php + echo elgg_view('input/submit', array('value' => elgg_echo("tasks:comments:post"))); +?> + </div> +<?php + } + + echo elgg_view('input/hidden', array( + 'name' => 'entity_guid', + 'value' => $vars['entity']->getGUID() + )); +} diff --git a/views/default/forms/tasks/edit.php b/views/default/forms/tasks/edit.php new file mode 100644 index 000000000..27061987d --- /dev/null +++ b/views/default/forms/tasks/edit.php @@ -0,0 +1,63 @@ +<?php +/** + * Task edit form body + * + * @package ElggTasks + */ + +$variables = elgg_get_config('tasks'); +foreach ($variables as $name => $type) { +?> +<div> +<?php + // dont show label for task lists since for now it's hidden + if ($type != 'tasks/list') { +?> + <label><?php echo elgg_echo("tasks:$name") ?></label> + <?php + if ($type != 'longtext') { + echo '<br />'; + } + } + ?> + <?php echo elgg_view("input/$type", array( + 'name' => $name, + 'value' => $vars[$name], + )); + ?> +</div> +<?php +} + +$cats = elgg_view('categories', $vars); +if (!empty($cats)) { + echo $cats; +} + + +echo '<div class="elgg-foot">'; +if ($vars['guid']) { + echo elgg_view('input/hidden', array( + 'name' => 'task_guid', + 'value' => $vars['guid'], + )); +} +echo elgg_view('input/hidden', array( + 'name' => 'container_guid', + 'value' => $vars['container_guid'], +)); +echo elgg_view('input/hidden', array( + 'name' => 'list_guid', + 'value' => $vars['list_guid'], +)); +// Referers value isn't saved in the task +if ($vars['referer_guid']) { + echo elgg_view('input/hidden', array( + 'name' => 'referer_guid', + 'value' => $vars['referer_guid'], + )); +} + +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); + +echo '</div>'; diff --git a/views/default/forms/tasks/inline.php b/views/default/forms/tasks/inline.php new file mode 100644 index 000000000..68075ce09 --- /dev/null +++ b/views/default/forms/tasks/inline.php @@ -0,0 +1,35 @@ +<?php +/* + * + */ +echo '<h3>'.elgg_echo('tasks:add').'</h3>'; +echo elgg_view('input/text', array( + 'name' => 'title', + 'class' => 'elgg-autofocus', +)); +echo elgg_view('input/access', array( + 'name' => 'access_id', + 'value' => $vars['list']->access_id, +)); +echo elgg_view('input/hidden', array( + 'name' => 'tags', + 'value' => '', +)); +echo '<div class="elgg-foot mtm">'; +echo elgg_view('input/hidden', array( + 'name' => 'list_guid', + 'value' => $vars['list']->guid, +)); +echo elgg_view('input/hidden', array( + 'name' => 'container_guid', + 'value' => $vars['list']->container_guid, +)); +echo elgg_view('input/submit', array( + 'value' => elgg_echo('save'), +)); +echo elgg_view('output/url', array( + 'text' => elgg_echo('tasks:add:gofull'), + 'href' => "tasks/add/{$vars['list']->guid}", + 'class' => 'elgg-button elgg-button-special' +)); +echo '</div>';
\ No newline at end of file |