Skip to content
Snippets Groups Projects
Commit eaf761f7 authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Get edit profile working on mobile!!

parent 4b457005
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,17 @@
$field = $vars['field'];
$title = $vars['title'];
$description = $vars['description'];
$internalname = preg_replace('/\<[\w\W]+name="/i','',$vars['field']);
$internalname = trim(preg_replace('/"[\W\w]*\>/i','',$internalname));
$body = <<<END
<label>$title<br />
$field
</label>
<p class="form-field-description">$description</p>
<li>
<label for="$internalname">
$title
<span class="helper">$description</span>
</label>
$field
</li>
END;
print $body;
?>
\ No newline at end of file
......@@ -33,6 +33,8 @@ $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>
......@@ -53,5 +55,9 @@ END;
$body .= $html;
}
}
*/
$body .= $tab_data['main']["Basic"];
echo $body;
?>
\ No newline at end of file
<?php
/**
* Elgg flex profile edit form
* Modified for UNL mobile planetred
* Allows user to edit profile
*
* @package Elgg
......@@ -13,72 +12,44 @@
*/
// Load flexprofile model
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/flexprofile/models/model.php");
$user = $vars['entity'];
$form = flexprofile_get_profile_form($user);
if ($form) {
$tab_data = flexprofile_get_data_for_edit_form($form, $user);
/* mjuhl: begin modification for UNL */
// nope, remove this:
//echo '<div class="contentWrapper">';
if ($_GET['firstlogin'] == 'yes'){
if (get_input('firstlogin') == 'yes') {
?>
<div class="zenbox soothing">
<h3>Thanks for joining Planet Red!</h3>
<p>You're just a few quick steps from putting yourself on the map. Start by filling out your profile information.</p>
</div>
</div><br /><br />
<?php
}
/* import forms css */
//////////echo '<style type="text/css">@IMPORT url("/wdn/templates_3.0/css/content/forms.css");</style>';
/* add 'cool' class to form */
//////////echo '<div id="formloading"><img src="/wdn/templates_3.0/css/header/images/colorbox/loading.gif" alt="Loading Form" /><noscript>Please enable JavaScript to use the profile editor.</noscript></div>';
echo '<form style="margin-top: 24px" action="'.$vars['url'].'action/flexprofile/edit" method="post" enctype="multipart/form-data" class="cool">';
/* add fieldset and legend */
echo '<fieldset><legend>Edit Information</legend><ol>';
//echo '<div id="formloading"><img src="/wdn/templates_3.0/css/header/images/colorbox/loading.gif" alt="Loading Form" /><noscript>Please enable JavaScript to use the profile editor.</noscript></div>';
echo '<form action="'.$vars['url'].'action/flexprofile/edit" method="post" enctype="multipart/form-data" class="zenform primary" id="profileEditor" >';
echo elgg_view('input/securitytoken');
echo '<fieldset><ol>';
echo elgg_view('form/forms/display_form_content',array('tab_data'=>$tab_data,'description'=>'','preview'=>0,'form'=>$form,'form_data_id'=>0));
if ($_GET['firstlogin'] == 'yes'){
?>
<input type="hidden" name="firstlogin" value="yes" />
<?php
if (get_input('firstlogin') == 'yes') {
echo '<input type="hidden" name="firstlogin" value="yes" />';
}
echo '</ol></fieldset>';
?>
<input type="hidden" name="form_id" value="104" /> <input type="hidden" name="preview" value="0" /> <input type="hidden" name="form_data_id" value="0" />
<input type="hidden" name="username" value="<?php echo page_owner_entity()->username; ?>" />
</fieldset>
<?php
?>
<p class="submit">
<p>
<input type="hidden" name="username" value="<?php echo page_owner_entity()->username; ?>" />
<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
</p>
</ol>
</form>
<script type="text/javascript" src="/wdn/templates_3.0/scripts/jquery.js"></script>
<script type="text/javascript" src="http://ucommjuhl.unl.edu/planetred/elgg/mod/unl_theme/scripts/JS/enhanceProfileForm.php"></script>
<script type="text/javascript">$("p.form-field-description").css({"margin-top": "1px", "margin-left": "1px", "margin": "0px"});</script>
<noscript>
<p>Sorry, the profile editor requires JavaScript. Please enable JavaScript in your browser, or sign in to Planet Red with a browser that supports JavaScript.</p>
<style type="text/css">
form.cool {
display: none;
}
</style>
</noscript>
<?php
echo '</form>';
} else {
echo elgg_echo('form:error_no_profile_form');
}
// once again, nope:
//echo '</div>';
/* mjuhl: end modification */
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/unl_theme/scripts/JS/enhanceProfileForm.php');
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment