diff options
Diffstat (limited to 'mod/cool_theme/views/default/forms')
5 files changed, 175 insertions, 0 deletions
diff --git a/mod/cool_theme/views/default/forms/comments/add.php b/mod/cool_theme/views/default/forms/comments/add.php new file mode 100644 index 000000000..55341ea46 --- /dev/null +++ b/mod/cool_theme/views/default/forms/comments/add.php @@ -0,0 +1,39 @@ +<?php +/** + * Elgg comments add form + * + * @package Elgg + * + * @uses ElggEntity $vars['entity'] The entity to comment on + * @uses bool $vars['inline'] Show a single line version of the form? + */ + + +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', + 'placeholder' => elgg_echo('annotation:generic_comment:value:placeholder'), + )); + echo elgg_view('input/submit', array( + 'value' => elgg_echo('comment'), + 'class' => 'hidden', + )); + } else { +?> + <div> + <label><?php echo elgg_echo("generic_comments:add"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> + </div> +<?php + echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post"))); + } + + echo elgg_view('input/hidden', array( + 'name' => 'entity_guid', + 'value' => $vars['entity']->getGUID() + )); +}
\ No newline at end of file diff --git a/mod/cool_theme/views/default/forms/discussion/reply/save.php b/mod/cool_theme/views/default/forms/discussion/reply/save.php new file mode 100644 index 000000000..5fb94d488 --- /dev/null +++ b/mod/cool_theme/views/default/forms/discussion/reply/save.php @@ -0,0 +1,28 @@ +<?php +/** + * Discussion topic reply form bofy + * + * @uses $vars['entity'] A discussion topic object + * @uses $vars['inline'] Display a shortened form? + */ + +if (isset($vars['entity']) && elgg_is_logged_in()) { + $inline = elgg_extract('inline', $vars, false); + + if ($inline) { + echo elgg_view('input/text', array('name' => 'group_topic_post', 'placeholder' => elgg_echo('annotation:group_topic_post:value:placeholder'))); + echo elgg_view('input/submit', array('value' => elgg_echo('reply'), 'class' => 'hidden')); + } else { +?> + <div> + <label><?php echo elgg_echo("reply"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'group_topic_post')); ?> + </div> +<?php + echo elgg_view('input/submit', array('value' => elgg_echo('reply'))); + } + echo elgg_view('input/hidden', array( + 'name' => 'entity_guid', + 'value' => $vars['entity']->getGUID(), + )); +} diff --git a/mod/cool_theme/views/default/forms/profile/edit.php b/mod/cool_theme/views/default/forms/profile/edit.php new file mode 100644 index 000000000..46b77a95b --- /dev/null +++ b/mod/cool_theme/views/default/forms/profile/edit.php @@ -0,0 +1,67 @@ +<?php +/** + * Edit profile form + * + * @uses vars['entity'] + */ + +?> + +<div class="elgg-module elgg-module-info"><div class="elgg-head"> + <h3><?php echo elgg_echo('user:name:label'); ?></h3></div> + <?php echo elgg_view('input/text', array('name' => 'name', 'value' => $vars['entity']->name)); ?> +</div> +<?php + +$profile_fields = elgg_get_config('profile_fields'); +if (is_array($profile_fields) && count($profile_fields) > 0) { + foreach ($profile_fields as $shortname => $valtype) { + $metadata = elgg_get_metadata(array( + 'guid' => $vars['entity']->guid, + 'metadata_name' => $shortname + )); + if ($metadata) { + if (is_array($metadata)) { + $value = ''; + foreach ($metadata as $md) { + if (!empty($value)) { + $value .= ', '; + } + $value .= $md->value; + $access_id = $md->access_id; + } + } else { + $value = $metadata->value; + $access_id = $metadata->access_id; + } + } else { + $value = ''; + $access_id = ACCESS_DEFAULT; + } + +?> +<div class="elgg-module elgg-module-info"><div class="elgg-head"> + <h3><?php echo elgg_echo("profile:{$shortname}") ?></h3> + <?php + $params = array( + 'name' => $shortname, + 'value' => $value, + ); + echo elgg_view("input/{$valtype}", $params); + $params = array( + 'name' => "accesslevel[$shortname]", + 'value' => $access_id, + ); + echo elgg_view('input/access', $params); + ?> +</div> +<?php + } +} +?> +<div class="elgg-foot"> +<?php + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); + echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +?> +</div> diff --git a/mod/cool_theme/views/default/forms/profile/fields/add.php b/mod/cool_theme/views/default/forms/profile/fields/add.php new file mode 100644 index 000000000..1ea9c57a9 --- /dev/null +++ b/mod/cool_theme/views/default/forms/profile/fields/add.php @@ -0,0 +1,29 @@ +<?php +/** + * Add a new field to the set of custom profile fields + */ + +$label_text = elgg_echo('profile:label'); +$type_text = elgg_echo('profile:type'); + +$label_control = elgg_view('input/text', array('name' => 'label')); +$type_control = elgg_view('input/dropdown', array('name' => 'type', 'options_values' => array( + 'text' => elgg_echo('profile:field:text'), + 'longtext' => elgg_echo('profile:field:longtext'), + 'tags' => elgg_echo('profile:field:tags'), + 'url' => elgg_echo('profile:field:url'), + 'email' => elgg_echo('profile:field:email'), + 'location' => elgg_echo('profile:field:location'), + 'date' => elgg_echo('profile:field:date'), +))); + +$submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); + +$formbody = <<< END + <div>$label_text: $label_control</div> + <div class="elgg-foot">$type_text: $type_control + $submit_control</div> +END; + +echo autop(elgg_echo('profile:explainchangefields')); +echo $formbody; diff --git a/mod/cool_theme/views/default/forms/profile/fields/reset.php b/mod/cool_theme/views/default/forms/profile/fields/reset.php new file mode 100644 index 000000000..c0bb1b7f4 --- /dev/null +++ b/mod/cool_theme/views/default/forms/profile/fields/reset.php @@ -0,0 +1,12 @@ +<?php +/** + * Reset profile fields form + */ + +echo '<div class="elgg-foot">'; +$params = array( + 'value' => elgg_echo('profile:resetdefault'), + 'class' => 'elgg-button-cancel', +); +echo elgg_view('input/submit', $params); +echo '</div>'; |