diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-07 05:10:11 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-07 05:10:11 +0000 |
commit | ea28c2c55c689be25a2212dfbdffd840c88921aa (patch) | |
tree | df452e639f62dbf3994bcf81c5622bd82d79016b /views/default/admin/appearance | |
parent | 59ae2874efb59aeb48265c16b785756025221fb8 (diff) | |
download | elgg-ea28c2c55c689be25a2212dfbdffd840c88921aa.tar.gz elgg-ea28c2c55c689be25a2212dfbdffd840c88921aa.tar.bz2 |
Pulled elgg-icon and elgg-icon-* into the admin css. Pulled out profile field JS into elgg.admin obj. Fixed editing profile field names.
git-svn-id: http://code.elgg.org/elgg/trunk@8061 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/admin/appearance')
-rw-r--r-- | views/default/admin/appearance/profile_fields/list.php | 78 |
1 files changed, 20 insertions, 58 deletions
diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index d14452f47..0b27da3ed 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -1,5 +1,7 @@ <?php - +/** + * Profile fields. + */ // List form elements $n = 0; @@ -19,70 +21,30 @@ if ($fieldlist = elgg_get_config('profile_custom_fields')) { } } ?> - -<script language="javascript" type="text/javascript" src="<?php echo elgg_get_site_url()?>vendors/jquery/jquery.jeditable.mini.js"></script> -<script language="javascript" type="text/javascript"> -var reorderURL = '<?php echo elgg_add_action_tokens_to_url(elgg_get_site_url() . 'action/profile/fields/reorder', FALSE); ?>'; -function sortCallback(event, ui) { - var orderArr = $('#sortable_profile_fields').sortable('toArray'); - var orderStr = orderArr.join(','); - jQuery.post(reorderURL, {'fieldorder': orderStr}); -} - -$(document).ready(function() { - $('#sortable_profile_fields').sortable({ - items: 'li', - handle: '.handle', - stop: sortCallback - }); -}); - -</script> - <div id="list"> <ul id="sortable_profile_fields"> <?php - $save = elgg_echo('save'); - $cancel = elgg_echo('cancel'); - $edit_url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/profile/editdefault/editfield", FALSE); - - foreach($items as $item) { - echo <<< END - -<script language="javascript" type="text/javascript"> - - $(function() { - $(".{$item->shortname}_editable").editable("$edit_url ", { - type : 'text', - submitdata: { _method: "post", 'field': '{$item->shortname}' }, - onblur: 'submit', - width:'300px', - height:'none', - style:'display:inline;', - tooltip:'Click to edit label' - }); - }); - -</script> - -END; - - echo elgg_view("profile/", array('value' => $item->translation)); - - //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/profile/fields/delete?id={$item->shortname}"); - echo "<li id=\"{$item->shortname}\"><div class='delete-button'><a href=\"$url\">" . elgg_echo('delete') . "</a></div>"; - echo "<img width='16' height='16' class='handle' alt='move' title='Drag here to reorder this item' src='".elgg_get_site_url()."mod/profile/graphics/drag-handle.png'/>"; - echo "<b class=\"profile_field_editable\"><span class=\"{$item->shortname}_editable\">$item->translation</span></b>: [".elgg_echo($item->type)."]"; - echo "</li>"; - - } +$save = elgg_echo('save'); +$cancel = elgg_echo('cancel'); + +foreach ($items as $item) { + echo elgg_view("profile/", array('value' => $item->translation)); + + //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/profile/fields/delete?id={$item->shortname}"); + $type = elgg_echo($item->type); + echo <<<HTML +<li id="$item->shortname" class="clearfix"><span class="elgg-icon elgg-icon-dragger elgg-state-draggable"></span> +<b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">$item->translation</span></b> [$type] +<a href="$url"><span class="elgg-icon elgg-icon-delete"></a></span> +</li> +HTML; +} ?> </ul> </div> <div id="tempList"></div> -<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $fieldlist; ?>" /> - +<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $fieldlist; ?>" />
\ No newline at end of file |