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

Initial work on mobile profile editor.

parent e1cbbbe0
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Elgg form display
*
* @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_t($form,'description');
}
if ($preview) {
$body = '<p class="form-description">'.elgg_echo('form:preview_description').'</p>';
} else {
$body = '';
}
$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));
$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" />
END;
$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($tab_data) == 1) {
foreach($tab_data as $tab => $html) {
$body .= $html;
}
}
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
* @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/
*/
// 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'){
?>
<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>
<?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 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
}
?>
<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">
<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
</p>
</ol>
</form>
<?php
} else {
echo elgg_echo('form:error_no_profile_form');
}
// once again, nope:
//echo '</div>';
/* mjuhl: end modification */
?>
\ 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