Skip to content
Snippets Groups Projects
Commit 681912af authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

move mobile form stuff out of form plugin and into mobile_unl plugin

parent c9f678b7
No related branches found
No related tags found
No related merge requests found
Showing
with 1571 additions and 4 deletions
.river_object_form_data_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
}
.river_object_form_data_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.form_listing .search_listing {
border:2px solid #cccccc;
margin:0 0 5px 0;
}
#groups_info_column_left .tabberlive .tabbertab {
background-color: white;
}
#profile_info_column_middle .tabberlive .tabbertab {
background-color: white;
}
\ No newline at end of file
<?php
/**
* Default form data display
*
* @package form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2009
* @link http://radagast.biz/
*/
$form_data_id = $vars['entity']->getGUID();
$data = form_get_data($form_data_id);
$form = get_entity($vars['entity']->form_id);
$tab_data = form_get_tabbed_output_display($form,$data);
echo elgg_view('form/forms/display_form_content',array('tab_data'=>$tab_data,'description'=>'','preview'=>0,'form'=>$form,'form_data_id'=>0));
echo $vars['annotations'];
?>
\ No newline at end of file
<?php
/**
* Default form data listing
*
* @package form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2009
* @link http://radagast.biz/
*/
$owner = $vars['entity']->getOwnerEntity();
$friendlytime = friendly_time($vars['entity']->time_created);
$icon = elgg_view(
"profile/icon", array(
'entity' => $owner,
'size' => 'small',
)
);
$info = '<p><a href="'.$vars['entity']->getURL().'">'.elgg_echo('form:submission_to').'</a> "'.get_entity($vars['entity']->form_id)->title.'"</p>';
$info .= "<p class=\"owner_timestamp\"><a href=\"{$owner->getURL()}\">{$owner->name}</a> {$friendlytime}</p>";
echo elgg_view_listing($icon,$info.$vars['annotations']);
?>
\ No newline at end of file
<?php
/**
* Elgg field display
* Displays the specified Elgg title, field and description
*
* @package Elgg
* @subpackage Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*/
$field = $vars['field'];
$title = $vars['title'];
$description = $vars['description'];
$body = <<<END
<label>$title<br />
$field
</label>
<p class="form-field-description">$description</p>
END;
print $body;
?>
\ No newline at end of file
<?php
/**
* Elgg display search form
*
* @package Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*
*/
// load form model
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/models/model.php");
echo '<div class="contentWrapper">';
echo form_view_entities(array($vars['form_data']), $vars['form'], 'display');
echo '</div>';
?>
\ No newline at end of file
<?php
/**
* Elgg display search form
*
* @package Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*
*/
// load form model
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/models/model.php");
$form = get_entity($vars['form_id']);
$fd = get_entity($vars['form_data_id']);
if (isset($_SESSION['last_search_qs'])) {
$qs = $_SERVER["QUERY_STRING"];
// remove the form data id from the query string first
$qsi = strpos($qs,'&');
$qs = substr($qs,$qsi+1);
$return_to_search_results = '<p><a href="'.$CONFIG->wwwroot.'mod/form/search_results.php?'.$qs
.'">'.elgg_echo('form:return_to_search_results').'</a></p>';
} else {
$return_to_search_results = '';
}
echo '<div class="contentWrapper">';
echo $return_to_search_results;
echo form_view_entities(array($fd), $form, 'display');
echo $return_to_search_results;
echo '</div>';
?>
\ No newline at end of file
<?php
$form = $vars['form'];
$display_bit = '<div class="tabbertab" title="'.elgg_echo('form:display_templates_tab_label').'">';
$display_bit .= '<label for="list_template">'.elgg_echo('form:list_template_label');
$display_bit .= elgg_view('input/longtext',array('internalname'=>'list_template','value'=>$form->list_template));
$display_bit .= '</label>';
$display_bit .= '<p class="description">'.elgg_echo('form:list_template_description').'</p>';
$display_bit .= '<label for="display_template">'.elgg_echo('form:display_template_label');
$display_bit .= elgg_view('input/longtext',array('internalname'=>'display_template','value'=>$form->display_template));
$display_bit .= '</label>';
$display_bit .= '<p class="description">'.elgg_echo('form:display_template_description').'</p>';
$display_bit .= '<input type="submit" name="submit" value="'.elgg_echo('form:form_manage_button').'">';
$display_bit .= '</div>';
echo $display_bit;
?>
\ No newline at end of file
<?php
// load form model
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/models/model.php");
$context = $vars['context'];
$offset = $vars['offset'];
$entities = $vars['entities'];
$form = $vars['form'];
$limit = $vars['limit'];
$count = $vars['count'];
$baseurl = $vars['baseurl'];
$context = $vars['context'];
$viewtype = $vars['viewtype'];
$html = "";
$nav = "";
if (isset($vars['viewtypetoggle'])) {
$viewtypetoggle = $vars['viewtypetoggle'];
} else {
$viewtypetoggle = true;
}
if ($context == "search" && $count > 0 && $viewtypetoggle) {
$nav .= elgg_view("navigation/viewtype",array(
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
'viewtype' => $viewtype,
));
}
$nav .= elgg_view('navigation/pagination',array(
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
'limit' => $limit,
));
$html .= $nav;
if ($fullview) {
$viewtype = 'display';
}
if (is_array($entities) && sizeof($entities) > 0) {
$html .= form_view_entities($entities, $form, $viewtype);
}
if ($count)
$html .= $nav;
echo $html;
?>
\ No newline at end of file
<?php
/**
* Form extended field display
*
* @package form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*/
$value = $vars['value'];
$title = $vars['title'];
$body = <<<END
<label>$title<br />
<p>$value</p>
</label>
END;
print $body;
?>
\ No newline at end of file
<?php
$form_id = $vars['form_id'];
$profile = $vars['profile'];
$edit_msg = elgg_echo('form:edit');
$remove_msg = elgg_echo('form:remove');
$remove_confirm_msg = elgg_echo('form:remove_confirm');
$moveup_msg = elgg_echo('form:move_up');
$movedown_msg = elgg_echo('form:move_down');
$movetop_msg = elgg_echo('form:move_top');
$movebottom_msg = elgg_echo('form:move_bottom');
$img_template = '<img border="0" width="16" height="16" alt="%s" title="%s" src="'.$vars['config']->wwwroot.'mod/form/images/%s" />';
$edit_img = sprintf($img_template,$edit_msg,$edit_msg,"16-em-pencil.png");
$remove_img = sprintf($img_template,$remove_msg,$remove_msg,"16-em-cross.png");
$moveup_img = sprintf($img_template,$moveup_msg,$moveup_msg,"16-em-open.png");
$movedown_img = sprintf($img_template,$movedown_msg,$movedown_msg,"16-em-down.png");
$movetop_img = sprintf($img_template,$movetop_msg,$movetop_msg,"16-em-left.png");
$movebottom_img = sprintf($img_template,$movebottom_msg,$movebottom_msg,"16-em-right.png");
$start_url = $vars['config']->wwwroot.'action/form/manage_field?form_action=move&id=%s&form_id=%s&direction=';
$link_template = '<a onclick="javascript:$(\'#field_list\').load(\'%s%s\'); return false;" href="%s%s">%s</a>';
$field_template = <<<END
<a href="{$vars['config']->wwwroot}action/form/manage_field?form_action=edit&id=%s&form_id=%s&profile=$profile">$edit_img</a> |
<a onclick="return confirm('$remove_confirm_msg')" href="{$CONFIG->wwwroot}action/form/manage_field?form_action=remove&id=%s&form_id=%s">$remove_img</a> |
%s |
%s |
%s |
%s
%s
<br />
END;
$fields = $vars['fields'];
if ($fields && count($fields) > 0 ) {
foreach ($fields AS $field) {
$ident = $field->getGUID();
$url = sprintf($start_url,$ident,$form_id);
$up = sprintf($link_template,$url,'up',$url,'up',$moveup_img);
$down = sprintf($link_template,$url,'down',$url,'down',$movedown_img);
$top = sprintf($link_template,$url,'top',$url,'top',$movetop_img);
$bottom = sprintf($link_template,$url,'bottom',$url,'bottom',$movebottom_img);
$field_list .= sprintf( $field_template,$ident,$form_id,$ident,$form_id,
$up,$down,$top,$bottom,
$field->title . ' ('.$field->internal_name.': '.$field->field_type.')');
}
$field_list .= '<br />';
} else {
$field_list .= '<p>'.elgg_echo('form:none').'.</p>';
}
echo $field_list;
?>
\ No newline at end of file
<?php
$manage_bit = '<div class="form-manage">';
$manage_bit .= '<a href="'.$vars['url'].'mod/form/form.php?id='.$vars['form_id'].'&d='.$vars['form_data_id'].'">';
$manage_bit .= elgg_echo('form:edit');
$manage_bit .= '</a> | ';
$manage_bit .= '<a onclick="return confirm(\''.elgg_echo('form:content_delete_confirm').'\')" ';
$manage_bit .= 'href="'.$vars['url'].'action/form/manage_form_data?form_action=delete&d='.$vars['form_data_id'].'">';
$manage_bit .= elgg_echo('form:delete');
$manage_bit .= '</a>';
$manage_bit .= '</div><br />';
echo $manage_bit;
?>
\ No newline at end of file
<?php
/**
* Elgg field display
* Displays the specified Elgg title, field and description
*
* @package Elgg
* @subpackage Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*/
$tab_data = $vars['tab_data'];
$form = $vars['form'];
$preview = $vars['preview'];
$form_data_id = $vars['form_data_id'];
if (isset($vars['description'])) {
$description = $vars['description'];
} else {
$description = form_form_t($form,'description');
}
if ($preview) {
$body = '<div class="contentWrapper">'.elgg_echo('form:preview_description').'</div>';
} else {
$body = '';
}
// TODO - add some intelligent way to determine the form enctype?
$body .= <<<END
<script type="text/javascript" src="{$vars['url']}mod/form/tabber/tabber.js"></script>
<link rel="stylesheet" href="{$vars['url']}mod/form/tabber/example.css" type="text/css" media="screen" />
<div class="contentWrapper">
$description
</div>
<div class="contentWrapper">
<form action="{$vars['url']}action/form/submit" method="post" enctype="multipart/form-data">
END;
$body .= elgg_view('input/hidden',array('internalname'=>'form_id', 'value'=>$form->getGUID()));
$body .= elgg_view('input/hidden',array('internalname'=>'preview', 'value'=>$preview));
$body .= elgg_view('input/hidden',array('internalname'=>'form_data_id', 'value'=>$form_data_id));
$count = count($tab_data);
if ($count > 1) {
$body .= '<div class="tabber">';
$body .= '<div class="tabberloading" ></div>';
foreach($tab_data as $tab => $html) {
if ($html) {
$body .= "<div class=\"tabbertab\" title=\"$tab\">";
$body .= $html;
$body .= "</div>\n";
}
}
$body .= '</div>';
} else if ($count == 1) {
// don't show tabs if there is only one
foreach($tab_data as $tab => $html) {
$body .= $html;
}
}
$body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('form:submit')));
$body .= '</form></div>';
print $body;
?>
\ No newline at end of file
......@@ -33,10 +33,7 @@ $body .= elgg_view('input/hidden',array('internalname'=>'preview', 'value'=>$pre
$body .= elgg_view('input/hidden',array('internalname'=>'form_data_id', 'value'=>$form_data_id));
$body .= "<p class=\"form-description\">$description</p>";
if (count($tab_data) > 1) {
$body .= <<<END
<script type="text/javascript" src="{$CONFIG->wwwroot}mod/form/tabber/tabber.js"></script>
<link rel="stylesheet" href="{$CONFIG->wwwroot}mod/form/tabber/example.css" type="text/css" media="screen" />
......@@ -57,5 +54,4 @@ END;
}
}
echo $body;
?>
\ No newline at end of file
<?php
/* buttons and links:
*
* preview form (link)
* add existing field (input box for field name)
* copy existing field (copies field definition) (input boxes for field name)
* add new field (input box for field name)
*/
$form_id = $vars['form_id'];
$profile = $vars['profile'];
//TODO: clean this up
$add_existing_button = elgg_echo('form:add_existing_button');
$add_existing_field_description = elgg_echo('form:add_existing_field_description');
$copy_existing_button = elgg_echo('form:copy_existing_button');
$copy_existing_field_description = elgg_echo('form:copy_existing_field_description');
$add_new_button = elgg_echo('form:add_new_button');
$add_new_description = elgg_echo('form:add_new_description');
$existing_label = elgg_echo('form:existing_label');
$new_label = elgg_echo('form:new_label');
$add_fields_title = elgg_echo('form:add_fields_title');
$add_existing_title = elgg_echo('form:add_existing_title');
$copy_existing_title = elgg_echo('form:copy_existing_title');
$add_new_title = elgg_echo('form:add_new_title');
$field_adders_tab = elgg_echo('form:field_adders_tab_label');
$buttons = <<<END
<div class="tabbertab" title="$field_adders_tab">
<form action="{$vars['url']}action/form/manage_field" method="post">
<input type="hidden" name="form_id" value="$form_id">
<input type="hidden" name="form_action" value="add_new">
<input type="hidden" name="profile" value="$profile">
<label class="labelclass" for="new_field_name">$new_label</label>
END;
$buttons .= elgg_view('input/text',array('internalname'=>'new_field_name'));
$buttons .= <<<END
<br />
<span class="description">$add_new_description<br />
<input type="submit" name="submit" value="$add_new_button"></span>
</form>
<br />
<form action="{$vars['url']}action/form/manage_field" method="post">
<input type="hidden" name="form_id" value="$form_id">
<input type="hidden" name="form_action" value="add_existing">
<input type="hidden" name="profile" value="$profile">
<label class="labelclass" for="existing_field_name">$existing_label</label>
END;
$buttons .= elgg_view('input/text',array('internalname'=>'existing_field_name'));
$buttons .= <<<END
<br />
<span class="description">$add_existing_field_description<br />
<input type="submit" name="submit" value="$add_existing_button"></span>
</form>
<form action="{$vars['url']}action/form/manage_field" method="post">
<input type="hidden" name="form_id" value="$form_id">
<input type="hidden" name="form_action" value="copy_existing">
<input type="hidden" name="profile" value="$profile">
<label class="labelclass" for="existing_field_name">$existing_label</label>
END;
$buttons .= elgg_view('input/text',array('internalname'=>'existing_field_name'));
$buttons .= <<<END
<label class="labelclass" for="new_field_name">$new_label</label>
END;
$buttons .= elgg_view('input/text',array('internalname'=>'new_field_name'));
$buttons .= <<<END
<p class="description">$copy_existing_field_description<br />
<input type="submit" name="submit" value="$copy_existing_button"></p>
</form>
</div>
END;
echo $buttons;
?>
\ No newline at end of file
<?php
/**
* Elgg list fields view
*
* @package Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*
* @uses $vars['form'] Optionally, the form to edit
*/
$type = $vars['page_return_type'];
$fields = $vars['fields'];
$username = $vars['user']->username;
$edit_msg = elgg_echo('form:edit');;
$delete_msg = elgg_echo('form:delete');
$delete_orphans_confirm_msg = elgg_echo('form:orphan_delete_all_confirm');
if ($type == 'orphan') {
$delete_confirm_msg = elgg_echo('form:orphan_delete_confirm');
} else {
$delete_confirm_msg = elgg_echo('form:field_delete_confirm');
}
$img_template = '<img border="0" width="16" height="16" alt="%s" title="%s" src="'.$CONFIG->wwwroot.'mod/form/images/%s" />';
$edit_img = sprintf($img_template,$edit_msg,$edit_msg,"16-em-pencil.png");
$delete_img = sprintf($img_template,$delete_msg,$delete_msg,"16-em-cross.png");
$field_template = <<<END
<a href="{$CONFIG->wwwroot}action/form/manage_field?form_action=edit_with_field_id&id=%s&type=%s&username=$username">$edit_img</a> |
<a onclick="return confirm('$delete_confirm_msg')" href="{$CONFIG->wwwroot}action/form/manage_field?form_action=delete&id=%s&type=%s&username=$username">$delete_img</a>
&nbsp;&nbsp;&nbsp;%s
<br />
END;
$body .= '<div class="contentWrapper">';
if ($type == 'orphan') {
$body .= '<p><b><a onclick="return confirm(\''.$delete_orphans_confirm_msg.'\')" href="'.$CONFIG->wwwroot.'action/form/manage_fields?form_action=delete_orphans&username='.$username.'">'.elgg_echo('form:delete_orphans').'</a></b></p> '."\n";
$body .= '<p>'.elgg_echo('form:orphan_list_description').'</p>'."\n";
} else {
$body .= '<p>'.elgg_echo('form:field_list_description').'</p>'."\n";
}
if ($fields) {
foreach ($fields as $field) {
$field_id = $field->getGUID();
$body .= sprintf(
$field_template,
$field_id,
$type,
$field_id,
$type,
$field->title . ' ('.$field->internal_name.': '.$field->field_type.')');
}
} else {
$body .= '<p>'.elgg_echo('form:no_fields').'</p>';
}
$body .= '</div>';
print $body;
?>
\ No newline at end of file
<?php
/*
* Elgg Forms
* Kevin Jardine
* Radagast Solutions
* http://radagast.biz
*
* Displays existing forms
*
*/
// load form model
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/models/model.php");
//$title = elgg_echo('form:list_forms_title');
$view_all_text = elgg_echo('form:view_all');
$form_template = <<<END
<div class="contentWrapper">
<h2>%s</h2>
<p>
%s
</p>
%s
<a href="{$CONFIG->wwwroot}mod/form/my_forms.php?id=%s&form_view=all">$view_all_text</a>
%s
</div>
END;
//$pg_owner_entity = page_owner_entity();
//$username = $pg_owner_entity->username;
$body = '';
$profile_form = form_get_latest_public_profile_form();
if ($profile_form) {
$sd_list = get_entities_from_metadata('form_id',$profile_form->getGUID(),'object','form:search_definition');
if ($sd_list) {
$body .= '<div class="contentWrapper">';
$body .= '<h2>'.elgg_echo('form:profiles').'</h2><br />';
foreach($sd_list as $sd) {
$sd_id = $sd->getGUID();
$body .= "<a href=\"{$vars['url']}mod/form/search.php?sid=$sd_id\">".form_search_definition_t($form,$sd,'title')."</a><br />";
}
$body .= '</div>';
}
}
$forms = get_entities_from_metadata('profile','0','object','form:form');
if ($forms) {
foreach ($forms as $form) {
$form_id = $form->getGUID();
if (isloggedin()) {
$add_bit = '<a href="'.$vars['url'].'mod/form/form.php?id='.$form_id.'">'.elgg_echo('form:add_content').'</a> | ';
} else {
$add_bit = '';
}
$sd_bit = '';
$sd_list = get_entities_from_metadata('form_id',$form_id,'object','form:search_definition');
if ($sd_list) {
foreach($sd_list as $sd) {
$sd_id = $sd->getGUID();
$sd_bit .= "| <a href=\"{$vars['url']}mod/form/search.php?sid=$sd_id\">".form_search_definition_t($form,$sd,'title')."</a>";
}
}
$body .= sprintf($form_template,form_form_t($form,'title'),form_form_t($form,'listing_description'),$add_bit,$form_id,$sd_bit);
}
} else {
if (!$profile_form) {
$body .= '<p>'.elgg_echo('form:no_content').'</p>';
}
}
print $body;
?>
\ No newline at end of file
<?php
/*
* Elgg Forms
* Kevin Jardine
* Radagast Solutions
* http://radagast.biz
*
* Displays existing search definitions
*
*/
$edit_msg = elgg_echo('form:edit');
$delete_msg = elgg_echo('form:delete');
$delete_confirm_msg = elgg_echo('form:search_definition_delete_confirm');
$search_page = elgg_echo('form:search_page_link');
$img_template = '<img border="0" width="16" height="16" alt="%s" title="%s" src="'.$CONFIG->wwwroot.'mod/form/images/%s" />';
$edit_img = sprintf($img_template,$edit_msg,$edit_msg,"16-em-pencil.png");
$delete_img = sprintf($img_template,$delete_msg,$delete_msg,"16-em-cross.png");
$sd_template = <<<END
<a href="{$CONFIG->wwwroot}mod/form/manage_search_definition.php?sid=%s">$edit_img</a> |
<a onclick="return confirm('$delete_confirm_msg')" href="{$CONFIG->wwwroot}action/form/manage_search_definition?form_action=delete&sid=%s">$delete_img</a> |
<a href="{$CONFIG->wwwroot}mod/form/search.php?sid=%s">$search_page</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%s (%s)
<br />
END;
$body = '<div class="contentWrapper">';
$form_id = get_input('form_id',0);
$sds = get_entities_from_metadata('form_id',$form_id,'object','form:search_definition');
if ($sds) {
foreach ($sds as $sd) {
$ident = $sd->getGUID();
$body .= sprintf($sd_template,$ident,$ident,$ident,$sd->title,$sd->internalname);
}
} else {
$body .= '<p>'.elgg_echo('form:no_search_definitions').'</p>';
}
$body .= '</div>';
print $body;
?>
\ No newline at end of file
<?php
/*
* Elgg Forms
* Kevin Jardine
* Radagast Solutions
* http://radagast.biz
*
* Displays existing forms
*
*/
$title = elgg_echo('form:list_forms_title');
$edit_msg = elgg_echo('form:edit');
$delete_msg = elgg_echo('form:delete');
$delete_confirm_msg = elgg_echo('form:form_delete_confirm');
$img_template = '<img border="0" width="16" height="16" alt="%s" title="%s" src="'.$CONFIG->wwwroot.'mod/form/images/%s" />';
$edit_img = sprintf($img_template,$edit_msg,$edit_msg,"16-em-pencil.png");
$delete_img = sprintf($img_template,$delete_msg,$delete_msg,"16-em-cross.png");
$export_text = elgg_echo('form:export');
$preview_text = elgg_echo('form:preview');
$link_text = elgg_echo('form:link');
$form_template = <<<END
<a href="{$CONFIG->wwwroot}mod/form/manage_form.php?id=%s">$edit_img</a> |
<a onclick="return confirm('$delete_confirm_msg')" href="{$CONFIG->wwwroot}action/form/manage_form?form_action=delete&id=%s">$delete_img</a> |
<a href="{$CONFIG->wwwroot}mod/form/form.php?id=%s&preview=true">$preview_text</a> |
<a href="{$CONFIG->wwwroot}mod/form/form.php?id=%s">$link_text</a>
&nbsp;&nbsp;&nbsp;%s
<br />
END;
$body = '<div class="contentWrapper">';
/*$user_content_status = form_get_user_content_status();
$body .= '<h2>'.elgg_echo('form:user_content_status_title').'</h2><br />';
$options = array( 1=>elgg_echo('form:yes'),
0=>elgg_echo('form:no') );
$body .= '<form action="'.$CONFIG->wwwroot.'action/form/manage_form" method ="post" >';
$body .= elgg_view('input/hidden',array('internalname'=>'form_action', 'value'=>'user_content_status'));
$body .= elgg_view('form/input/radio',array('internalname'=>'user_content_status','options'=>$options,'value'=>$user_content_status));
$body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('form:submit')));
$body .= '</form>';*/
$body .= '<h2>'.elgg_echo('form:form_list').'</h2><br />';
$forms = get_entities('object','form:form');
if ($forms) {
foreach ($forms as $form) {
$ident = $form->getGUID();
$body .= sprintf($form_template,$ident,$ident,$ident,$ident,$form->title.' ('.$form->name.')');
}
} else {
$body .= '<p>'.elgg_echo('form:no_forms').'</p>';
}
$body .= '</div>';
echo $body;
?>
\ No newline at end of file
<?php
/**
* Elgg manage field page
*
* @package Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*
* @uses $vars['field'] The field to edit
* $vars['form_id'] The form to add a new field to
* $vars['new_field_name'] Optionally, an internal name for this field
*/
$form_field_types = form_get_form_field_types();
$i = 0;
foreach ($form_field_types as $type => $ft) {
if ($type == 'contact') {
$contact_index = $i;
} else if ($type == 'choices') {
$choices_index = $i;
}
$i += 1;
}
$form_id = $vars['form_id'];
$field = $vars['field'];
$choices = $vars['choices'];
$page_return_type = $vars['page_return_type'];
$new_field_name = $vars['new_field_name'];
$username = $vars['username'];
$profile_label = elgg_echo('form:profile_label');
$profile_description = elgg_echo('form:profile_description');
$yes = elgg_echo('form:yes');
$no = elgg_echo('form:no');
$profile_bit = <<<END
<label class="labelclass" for="profile">$profile_label</label>
<input type="radio" name="profile" value="0" onChange="vis();" %s> $no
<input type="radio" name="profile" value="1" onChange="vis();" %s> $yes
<p class="description">$profile_description</p>
END;
if (!isset($vars['profile'])) {
if ($form_id) {
$profile = get_entity($form_id)->profile;
} else {
$profile = 0;
}
} else {
$profile = $vars['profile'];
}
if (!$profile) {
$profile = 0;
}
// set up the field values
if ($field) {
if ($new_field_name) {
// this is duplicating an existing field
$form_action = 'add';
$field_id = 0;
$internal_name = $new_field_name;
} else {
$form_action = 'change';
$field_id = $field->getGUID();
$internal_name = $field->internal_name;
}
$form_title = $field->title;
$description = $field->description;
$field_type = $field->field_type;
// must do this because Elgg has trouble with metadata set to "0"
// in Elgg 1.5
$m = get_metadata_byname($field->getGUID(),'default_access');
if ($m) {
$default_access = $m->value;
if ($default_access !== '') {
$field_access = (int) $default_access;
} else {
$field_access = '';
}
} else {
$field_access = '';
}
$default_value = $field->default_value;
$is_keyword_tag = $field->is_keyword_tag;
if (in_array($field_type,array('url','email','aim','msn','skype','icq'))) {
$contact_type = $field_type;
$field_type = 'contact';
$contact_class = 'visible';
} else {
$contact_class = 'invisible';
$contact_type = '';
}
if (isset($choices)) {
$number_of_options = count($choices);
} else {
$number_of_options = 0;
}
if ($field_type == 'choices') {
$choices_class = 'visible';
if (($profile == 1) | ($profile == 2)) {
$is_keyword_tag_class = 'visible';
} else {
$is_keyword_tag_class = 'invisible';
}
} else {
$choices_class = 'invisible';
$is_keyword_tag_class = 'invisible';
}
$required_no_checked = '';
$required_yes_checked = '';
if ($field->required) {
$required_yes_checked = 'checked';
} else {
$required_no_checked = 'checked';
}
$admin_only_no_checked = '';
$admin_only_yes_checked = '';
if ($field->admin_only) {
$admin_only_yes_checked = 'checked';
} else {
$admin_only_no_checked = 'checked';
}
$profile_no_checked = '';
$profile_yes_checked = '';
if (($profile == 1) || ($profile==2)) {
$profile_yes_checked = 'checked';
$profile_class = 'visible';
} else {
$profile_no_checked = 'checked';
$profile_class = 'invisible';
}
// remove this for now
/*if ($profile_bit) {
$profile_bit = sprintf($profile_bit, $profile_no_checked, $profile_yes_checked);
}*/
$profile_bit = '';
$category = $field->tab;
$subtype_filter = $field->subtype_filter;
$invisible_no_checked = '';
$invisible_yes_checked = '';
if ($field->invisible) {
$invisible_yes_checked = 'checked';
} else {
$invisible_no_checked = 'checked';
}
$is_keyword_tag_no_checked = '';
$is_keyword_tag_yes_checked = '';
if ($is_keyword_tag) {
$is_keyword_tag_yes_checked = 'checked';
} else {
$is_keyword_tag_no_checked = 'checked';
}
// make this always invisible as it is not currently used
$is_keyword_tag_class = 'invisible';
$area_left_checked = '';
$area_right_checked = '';
$area_bottom_checked = '';
$area_no_checked = '';
if ($field->area == 'left') {
$area_left_checked = 'checked';
} else if ($field->area == 'right') {
$area_right_checked = 'checked';
} else if ($field->area == 'bottom') {
$area_bottom_checked = 'checked';
} else {
$area_no_checked = 'checked';
}
$choice_type_select_checked = '';
$choice_type_radio_checked = '';
$choice_type_checkbox_checked = '';
if ($field->choice_type == 'pulldown') {
$choice_type_select_checked = 'checked';
$orientation_class = 'invisible';
} else if ($field->choice_type == 'radio') {
$choice_type_radio_checked = 'checked';
$orientation_class = 'visible';
} else {
$choice_type_checkbox_checked = 'checked';
$orientation_class = 'visible';
}
$orientation_horizontal_checked = '';
$orientation_vertical_checked = '';
if ($field->orientation == 'horizontal') {
$orientation_horizontal_checked = 'checked';
} else {
$orientation_vertical_checked = 'checked';
}
} else {
$form_action = 'add';
$number_of_options = 0;
//$profile = $vars['profile'];
$orientation_class = 'invisible';
$profile_class = 'invisible';
$choices_class = 'invisible';
$contact_class = 'invisible';
$is_keyword_tag_class = 'invisible';
$field_id = 0;
$internal_name = $new_field_name;
$form_title = '';
$description = '';
$field_type = 'profile_shorttext';
$field_access = '';
$contact_type = 'web';
$default_value = '';
$is_keyword_tag_no_checked = 'checked';
$is_keyword_tag_yes_checked = '';
// make this always invisible as it is not currently used
$is_keyword_tag_class = 'invisible';
$required_no_checked = 'checked';
$required_yes_checked = '';
$admin_only_no_checked = 'checked';
$admin_only_yes_checked = '';
$profile_no_checked = '';
$profile_yes_checked = '';
if (($profile == 1) || ($profile == 2)) {
$profile_yes_checked = 'checked';
$profile_class = 'visible';
$profile_bit = '<input type="hidden" name="profile" value="'.$profile.'1">';
} else {
$profile_no_checked = 'checked';
$profile_class = 'invisible';
// for now lock this in
// will have a toggle when I introduce mixed forms
//$profile_bit = sprintf($profile_bit, $profile_no_checked, $profile_yes_checked);
$profile_bit = '<input type="hidden" name="profile" value="'.$profile.'">';
}
$category = '';
$subtype_filter = '';
$invisible_no_checked = 'checked';
$invisible_yes_checked = '';
$registration_no_checked = 'checked';
$registration_yes_checked = '';
$area_right_checked = 'checked';
$area_left_checked = '';
$area_bottom_checked = '';
$area_no_checked = '';
$choice_type_select_checked = 'checked';
$choice_type_radio_checked = '';
$choice_type_checkbox_checked = '';
$orientation_horizontal_checked = 'checked';
$orientation_vertical_checked = '';
}
// define the Javascript and CSS
$body = <<<END
<script>
number_of_options = $number_of_options;
function vis() {
var x,v;
// show profile config if relevant
v = document.field_form.profile;
x = document.getElementById('profile_config');
/*if (v && v[1] && v[1].checked) {
x.className = 'visible';
} else {
x.className = 'invisible';
}*/
// hack to make this always visible for now
profile = $profile;
if ((profile == 1) || (profile == 2)) {
x.className = 'visible';
} else {
x.className = 'invisible';
}
// show choice config if relevant
//u = document.field_form.profile;
v = document.field_form.field_type;
x = document.getElementById('choices_config');
y = document.getElementById('contact_config');
z = document.getElementById('is_keyword_tag_config');
z.className = 'invisible';
if (v.options[$choices_index].selected) {
x.className = 'visible';
y.className = 'invisible';
//if (u[1].checked) {
// z.className = 'visible';
//}
} else if (v.options[$contact_index].selected) {
x.className = 'invisible';
y.className = 'visible';
} else {
x.className = 'invisible';
y.className = 'invisible';
}
// show orientation config if relevant
v = document.field_form.choice_type;
x = document.getElementById('orientation_config');
if (v[1].checked || v[2].checked) {
x.className = 'visible';
} else {
x.className = 'invisible';
}
}
function add_option() {
var o,el;
o = document.getElementById('option_container');
el = document.createElement('input');
el.type = 'text';
el.className = "option_value_input";
el.name = "option_"+number_of_options+"_value";
el.value = "";
o.appendChild(el);
el = document.createElement('input');
el.type = 'text';
el.className = "option_label_input";
el.name = "option_"+number_of_options+"_label";
el.value = "";
o.appendChild(el);
el = document.createElement('br');
o.appendChild(el);
number_of_options++;
document.field_form.number_of_options.value = number_of_options;
x = document.getElementById('option_outer_container');
x.className = 'visible';
}
</script>
<style>
div.invisible {
display: none;
}
div.visibleright {
float:right;
width: 100px;
}
label.labelclass {
display:block;
font-weight:bold;
}
p.description {
font-size: 0.9em;
margin-top: 0px;
}
span.option_value_header {
font-weight: bold;
width: 150px;
display: block;
float: left;
}
span.option_label_header {
font-weight: bold;
width: 300px;
margin-left: 10px;
}
input.option_value_input {
width:150px;
}
input.option_label_input {
margin-left:10px;
width:300px;
}
input.standard {
width: 100%;
}
input.longer {
width:100%;
}
</style>
END;
print $body;
// define a whole lot of text
$horizontal = elgg_echo('form:horizontal');
$vertical = elgg_echo('form:vertical');
if ($form_action == 'add') {
$title = elgg_echo('form:add_field_title');
$form_description = elgg_echo('form:add_field_description');
} else {
$title = elgg_echo('form:manage_field_title');
$form_description = elgg_echo('form:manage_field_description');
}
$internal_name_label = elgg_echo('form:internal_name_label');
$internal_name_description = elgg_echo('form:internal_name_description');
$title_label = elgg_echo('form:title_label');
$title_description = elgg_echo('form:title_description');
$description_label = elgg_echo('form:description_label');
$description_description = elgg_echo('form:description_description');
$required_label = elgg_echo('form:required_label');
$required_description = elgg_echo('form:required_description');
$admin_only_label = elgg_echo('form:admin_only_label');
$admin_only_description = elgg_echo('form:admin_only_description');
$field_type_label = elgg_echo('form:field_type_label');
$profile_config_title = elgg_echo('form:profile_config_title');
$category_label = elgg_echo('form:category_label');
$category_description = elgg_echo('form:category_description');
$subtype_label = elgg_echo('form:subtype_label');
$subtype_description = elgg_echo('form:subtype_description');
$invisible_label = elgg_echo('form:invisible_label');
$invisible_description = elgg_echo('form:invisible_description');
$registration_label = elgg_echo('form:registration_label');
$registration_description = elgg_echo('form:registration_description');
$column_label = elgg_echo('form:column_label');
$column_description = elgg_echo('form:column_description');
$choice_header = elgg_echo('form:choice_header');
$choice_field_type_label = elgg_echo('form:choice_field_type_label');
$choice_field_type_description = elgg_echo('form:choice_field_type_description');
$dropdown = elgg_echo('form:dropdown');
$radio = elgg_echo('form:radio');
$checkbox = elgg_echo('form:checkbox');
$default_value_label = elgg_echo('form:default_value_label');
$default_value_description = elgg_echo('form:default_value_description');
$is_keyword_tag_label = elgg_echo('form:is_keyword_tag_label');
$is_keyword_tag_description = elgg_echo('form:is_keyword_tag_description');
$orientation_label = elgg_echo('form:orientation_label');
$orientation_description = elgg_echo('form:orientation_description');
$access_label = elgg_echo('form:access_label');
$access_description = elgg_echo('form:access_description');
$options_header = elgg_echo('form:options_header');
$options_value_header = elgg_echo('form:options_value_header');
$options_label_header = elgg_echo('form:options_label_header');
$options_description = elgg_echo('form:options_description');
$options_add_button = elgg_echo('form:options_add_button');
$profile_left = elgg_echo('form:profile_left');
$profile_right = elgg_echo('form:profile_right');
$profile_bottom = elgg_echo('form:profile_bottom');
// set up some form components
if ($form_action == "add") {
$manage_field_button = elgg_echo('form:add_field_button');
} else {
$manage_field_button = elgg_echo('form:change_field_button');
}
$this_form_link_text = elgg_echo('form:this_form_link_text');
$form_link_text = elgg_echo('form:form_link_text');
$field_link_text = elgg_echo('form:field_link_text');
// TODO: the following code shows the admin's access list.
// Try to find something more generic.
$access_options = get_write_access_array();
$access_options[''] = elgg_echo('form:use_system_default_access');
/*$access_options = array(
'' => elgg_echo('form:use_system_default_access'),
'PRIVATE' => elgg_echo('ACCESS_PRIVATE'),
'PUBLIC' => elgg_echo('ACCESS_PUBLIC'),
'LOGGED_IN' => elgg_echo('ACCESS_LOGGED_IN'),
);*/
$access = '<select name="default_access">'."\n";
foreach ($access_options AS $value => $label) {
if ($value === $field_access) {
$selected = 'selected';
} else {
$selected = '';
}
$access .= sprintf('<option value="%s" %s>%s</option>'."\n", $value, $selected, $label);
}
$access .= '</select>'."\n";
$field_type_select = '<select name="field_type" onChange="vis();">'."\n";
foreach ($form_field_types AS $value => $ft) {
if ($value == $field_type) {
$selected = 'selected';
} else {
$selected = '';
}
$field_type_select .= sprintf('<option value="%s" %s>%s</option>'."\n", $value, $selected, $ft->label);
}
$field_type_select .= '</select>'."\n";
$contact_options = array(
'url' => elgg_echo("form:url"),
'email' => elgg_echo("form:email"),
'aim' => elgg_echo("form:aim"),
'msn' => elgg_echo("form:msn"),
'skype' => elgg_echo("form:skype"),
'icq' => elgg_echo("form:icq"),
);
$contact_radio = '';
foreach ($contact_options AS $value => $label) {
if ($value == $contact_type) {
$checked = 'checked';
} else {
$checked = '';
}
$contact_radio .= sprintf('<input type="radio" name="contact_type" value="%s" %s /> %s'."\n", $value, $checked, $label);
}
$option_template = '<input class="option_value_input" type="text" name="option_%s_value" value="%s">';
$option_template .= '<input class="option_label_input" type="text" name="option_%s_label" value="%s">';
$option_template .= "<br />\n";
$options_bit = '';
if ($number_of_options > 0) {
$count = 0;
foreach($choices AS $option) {
$options_bit .= sprintf($option_template,$count,$option->value,$count,$option->label);
$count ++;
}
}
if (!$profile) {
// currently only content forms support required fields
$required_bit = <<<END
<label class="labelclass" for="required">$required_label</label>
<input type="radio" name="required" value="0" $required_no_checked> $no
<input type="radio" name="required" value="1" $required_yes_checked> $yes
<p class="description">$required_description</p>
END;
} else {
$required_bit = '';
}
// define the form
$body = <<< END
<div class="contentWrapper">
<p>$form_description</p>
<form name="field_form" action="{$CONFIG->wwwroot}action/form/manage_field" method="post">
<input type="hidden" name="form_action" value="$form_action">
<input type="hidden" name="form_id" value="$form_id">
<input type="hidden" name="field_id" value="$field_id">
<input type="hidden" name="number_of_options" value="$number_of_options">
<input type="hidden" name="type" value="$page_return_type">
<input type="hidden" name="username" value="$username">
<label class="labelclass" for="internal_name">$internal_name_label</label>
<input type="text" class="standard" name="internal_name" value="$internal_name">
<p class="description">$internal_name_description</p>
<label class="labelclass" for="title">$title_label</label>
<input type="text" class="standard" name="title" value="$form_title">
<p class="description">$title_description</p>
<label class="labelclass" for="description">$description_label</label>
<input type="text" class="longer" name="description" value="$description">
<p class="description">$description_description</p>
<label class="labelclass" for="default_value">$default_value_label</label>
<input type="text" class="standard" name="default_value" value="$default_value">
<p class="description">$default_value_description</p>
$required_bit
<label class="labelclass" for="admin_only">$admin_only_label</label>
<input type="radio" name="admin_only" value="0" $admin_only_no_checked> $no
<input type="radio" name="admin_only" value="1" $admin_only_yes_checked> $yes
<p class="description">$admin_only_description</p>
<label class="labelclass" for="category">$category_label</label>
<input type="text" class="standard" name="category" value="$category">
<p class="description">$category_description</p>
$profile_bit
<label class="labelclass" for="field_type">$field_type_label</label>
$field_type_select
<div id="contact_config" class="$contact_class">
$contact_radio
</div>
<div id="choices_config" class="$choices_class">
<br />
<h1>$choice_header</h1>
<label class="labelclass" for="choice_type">$choice_field_type_label</label>
<input type="radio" name="choice_type" onChange="javascript:vis();" value="pulldown" $choice_type_select_checked> $dropdown
<input type="radio" name="choice_type" onChange="javascript:vis();" value="radio" $choice_type_radio_checked> $radio
<input type="radio" name="choice_type" onChange="javascript:vis();" value="checkboxes" $choice_type_checkbox_checked> $checkbox
<p class="description">$choice_field_type_description</p>
<div id="is_keyword_tag_config" class="$is_keyword_tag_class">
<label class="labelclass" for="is_keyword_tag">$is_keyword_tag_label</label>
<input type="radio" name="is_keyword_tag" value="0" $is_keyword_tag_no_checked> $no
<input type="radio" name="is_keyword_tag" value="1" $is_keyword_tag_yes_checked> $yes
<p class="description">$is_keyword_tag_description</p>
</div>
<div id="orientation_config" class="$orientation_class">
<label class="labelclass" for="orientation">$orientation_label</label>
<input type="radio" name="orientation" value="horizontal" $orientation_horizontal_checked> $horizontal
<input type="radio" name="orientation" value="vertical" $orientation_vertical_checked> $vertical
<p class="description">$orientation_description</p>
</div>
<div id="option_outer_container" class="$choices_class">
<div id="option_container">
<h1>$options_header</h1>
<span class="option_value_header">$options_value_header</span>
<span class="option_label_header">$options_label_header</span>
<br />
$options_bit
<br />
</div>
<p class="description">$options_description</p>
</div>
<br />
<input type="button" name="option_button" value="$options_add_button" onClick="add_option();">
</div>
<div id="profile_config" class="$profile_class">
<br />
<h1>$profile_config_title</h1>
<br />
<label class="labelclass" for="invisible">$invisible_label</label>
<input type="radio" name="invisible" value="0" $invisible_no_checked> $no
<input type="radio" name="invisible" value="1" $invisible_yes_checked> $yes
<p class="description">$invisible_description</p>
<label class="labelclass" for="area">$column_label</label>
<input type="radio" name="area" value="left" $area_left_checked> $profile_left
<input type="radio" name="area" value="right" $area_right_checked> $profile_right
<input type="radio" name="area" value="bottom" $area_bottom_checked> $profile_bottom
<input type="radio" name="area" value="" $area_no_checked> $no
<p class="description">$column_description</p>
<label class="labelclass" for="default_access">$access_label</label>
$access
<p class="description">$access_description</p>
</div>
<br />
<input type="submit" value="$manage_field_button" />
</form>
</div>
END;
echo $body;
?>
\ No newline at end of file
<?php
/**
* Elgg manage form view
*
* @package Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <kevin@radagast.biz>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*
* @uses $vars['form'] Optionally, the form to edit
*/
$form = $vars['form'];
$username = $vars['form_username'];
$profile = $vars['profile'];
if ($form) {
if ($form->profile) {
$profile = $form->profile;
} else {
$profile = 0;
}
}
$type_options = form_type_options();
if ($form) {
$form_action = 'change';
$explanation = elgg_echo('form:form_manage_description');
$form_manage_button = elgg_echo('form:form_manage_button');
$form_id = $form->getGUID();
$form_name = $form->name;
$form_title = $form->title;
$description = $form->description;
$access_id = $form->access_id;
$field_list = elgg_view('form/field_list',array('fields' => $vars['fields'],'form_id' => $form_id, 'profile' => $profile));
if (($profile == 0) || ($profile == 3)) {
// this bit is just for data or file forms
$display_bit = elgg_view('form/display_templates',array('form'=>$form));
} else {
$display_bit = '';
}
$buttons = elgg_view('form/forms/field_adders',array('form_id'=>$form_id,'profile'=>$profile));
$basic_tab = elgg_echo('form:basic_tab_label');
$tab_bit= <<<END
<script type="text/javascript" src="{$vars['url']}mod/form/tabber/tabber.js"></script>
<link rel="stylesheet" href="{$vars['url']}mod/form/tabber/example.css" type="text/css" media="screen" />
<div class="tabber">
<div class="tabberloading" ></div>
<div class="tabbertab" title="$basic_tab">
END;
} else {
$form_action = 'add';
$manage_form_title = '';
$explanation = elgg_echo('form:create_form_description');
$form_manage_button = elgg_echo('form:create_form_button');
$form_id = 0;
$form_name = '';
$form_title = '';
$description = '';
$access_id = ACCESS_PRIVATE;
$display_bit = '';
$field_list = '';
$buttons = '';
$tab_bit = '';
}
// top of form
$body = <<<END
<div class="contentWrapper">
<p>$explanation</p>
$tab_bit
<form action="{$vars['config']->wwwroot}action/form/manage_form" method="post">
<h1>$manage_form_title</h1>
<input type="hidden" name="form_id" value="$form_id">
<input type="hidden" name="form_action" value="$form_action">
<input type="hidden" name="username" value="$username">
END;
// form name
$body .= '<label class="labelclass" for="form_name">'.elgg_echo('form:name_label').'</label>';
$body .= elgg_view('input/text',array('internalname'=>'form_name','value'=>$form_name));
$body .= '<p class="description">'.elgg_echo('form:name_description').'</p>';
// form title
$body .= '<label class="labelclass" for="form_title">'.elgg_echo('form:title_label').'</label>';
$body .= elgg_view('input/text',array('internalname'=>'form_title','value'=>$form_title));
$body .= '<p class="description">'.elgg_echo('form:form_title_description').'</p>';
// form content creation description
$body .= '<label class="labelclass" for="description">'.elgg_echo('form:description_label').'</label>';
$body .= elgg_view('input/longtext',array('internalname'=>'description','value'=>$description));
$body .= '<p class="description">'.elgg_echo('form:form_description_description').'</p>';
// form type
$body .= '<label class="labelclass" for="form_type">'.elgg_echo('form:type_label').'</label>';
$body .= elgg_view('input/pulldown',array('internalname'=>'profile','options_values'=>$type_options,'value'=>$profile));
$body .= '<p class="description">'.elgg_echo('form:type_description').'</p>';
// access levels
$body .= '<label class="labelclass" for="access">'.elgg_echo('form:form_access_label').'</label>';
$body .= elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id));
$body .= '<p class="description">'.elgg_echo('form:form_access_description').'</p>';
if ($form) {
$body .= '<input type="submit" name="submit" value="'.$form_manage_button.'">';
$body .= '</div>';
}
if ($profile != 3) {
// file forms don't use this
$body .= elgg_view('form/manage_form_last_bit',array('form'=>$form));
}
$body .= $display_bit;
if ($form) {
$body .= '</form>';
$body .= $buttons;
$body .= '<div class="tabbertab" title="'.elgg_echo('form:field_list_tab_label').'">';
$body .= '<h2>'.elgg_echo('form:current_fields').'</h2><br />';
$body .= '<div id="field_list">';
$body .= $field_list;
$body .= '</div>';
$body .= '</div>';
} else {
$body .= '<input type="submit" name="submit" value="'.$form_manage_button.'">';
$body .= '</form>';
}
// bottom of form
$body .= <<<END
</div>
END;
if ($form) {
$body .= '</div>';
}
print $body;
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment