Skip to content

Commit

Permalink
chore: code cleanup for Elgg 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Dec 18, 2015
1 parent 7081419 commit c191f38
Show file tree
Hide file tree
Showing 31 changed files with 770 additions and 787 deletions.
19 changes: 19 additions & 0 deletions classes/ColdTrick/ProfileManager/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
*/
class Users {

/**
* Changes the register form view vars so profile icons can be uploaded
*
* @param string $hook_name name of the hook
* @param string $entity_type type of the hook
* @param unknown $return_value return value
* @param unknown $parameters hook parameters
*
* @return void
*/
public static function registerViewVars($hook_name, $entity_type, $return_value, $parameters) {
if (elgg_extract('action_name', $return_value) !== 'register') {
return;
}

$return_value['enctype'] = 'multipart/form-data';
return $return_value;
}

/**
* Adds uploaded files to your profile
*
Expand Down
Binary file removed graphics/accordion.png
Binary file not shown.
8 changes: 4 additions & 4 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ function profile_manager_init() {
elgg_extend_view('css/admin', 'css/profile_manager/multiselect.css');
elgg_extend_view('css/elgg', 'css/profile_manager/multiselect.css');
elgg_extend_view('css/elgg', 'css/profile_manager/global.css');
elgg_extend_view('css/elgg', 'css/profile_manager/site');

elgg_extend_view('js/elgg', 'js/profile_manager/site.js');

elgg_extend_view('css/elgg', 'css/profile_manager/site.css');

// Register Page handler
elgg_register_page_handler('profile_manager', 'profile_manager_page_handler');

Expand Down Expand Up @@ -73,6 +71,8 @@ function profile_manager_init() {
// register hook for saving the new username
elgg_register_plugin_hook_handler('usersettings:save', 'user', '\ColdTrick\ProfileManager\Users::usernameChange');

elgg_register_plugin_hook_handler('view_vars', 'input/form', '\ColdTrick\ProfileManager\Users::registerViewVars');

// site join event handler
elgg_register_event_handler('create', 'member_of_site', '\ColdTrick\ProfileManager\Sites::createMember');
elgg_register_event_handler('delete', 'member_of_site', '\ColdTrick\ProfileManager\Sites::deleteMember');
Expand Down
14 changes: 7 additions & 7 deletions views/default/css/profile_manager/global.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#custom_fields_more_info_tooltip {
position:absolute;
border:1px solid #333333;
background:#e4ecf5;
color:#333333;
padding:5px;
display:none;
position: absolute;
border: 1px solid #333333;
background: #e4ecf5;
color: #333333;
padding: 5px;
display: none;
width: 250px;
line-height: 1.2em;
font-size: 90%;
z-index:20000;
z-index: 20000;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<?php
$plugin_graphics_folder = elgg_get_site_url() . "mod/profile_manager/graphics/";
?>
/* widgets */
#widget_profile_completeness_container {
border: 1px solid #AAAAAA;
Expand Down Expand Up @@ -30,36 +27,21 @@
border: 2px solid #DEDEDE;
cursor: pointer;
margin-top: 5px;
margin-bottom: 0px;
padding: 5px;
}

#custom_fields_userdetails .ui-accordion-content {
border-style: solid;
border-color: #DEDEDE;
border-width: 0 2px 2px 2px;
padding: 5px 5px 0px;
padding: 5px;
}

#custom_fields_userdetails .ui-accordion-header:hover {
border-color: #CCCCCC;
}

#custom_fields_userdetails .ui-accordion-header .ui-icon {
margin-top: 1px;
background: url(<?php echo $plugin_graphics_folder; ?>accordion.png) no-repeat -16px 0;
width: 16px;
height: 16px;
float: left;
}

#custom_fields_userdetails .ui-accordion-header:hover .ui-icon{
background-position: -32px 0;
}

#custom_fields_userdetails .ui-accordion-header.ui-state-active .ui-icon {
background-position: 0 0;
}

/* fix for max-height multi-select drop down*/
.ui-dropdownchecklist-dropcontainer {
max-height: 150px;
Expand All @@ -84,7 +66,6 @@
padding-right: 25px;
}

/* extra explicit for IE7 */
.elgg-icon.profile_manager_validate_icon {
margin-left: -22px;
margin-top: 8px;
Expand Down Expand Up @@ -125,27 +106,11 @@
#profile_manager_username {
position: relative;
}

.elgg-icon-profile-manager-loading,
.elgg-icon-profile-manager-valid,
.elgg-icon-profile-manager-invalid {
#profile_manager_username > .elgg-icon {
position: absolute;
right: 5px;
top: 8px;
display: none;
}

.elgg-icon-profile-manager-loading {
background-image: url(<?php echo $plugin_graphics_folder; ?>loading.gif);
}

.elgg-icon-profile-manager-valid {
background-position: 0 -126px;
}

.elgg-icon-profile-manager-invalid {

background-position: 0 -252px;
}

/* End Account Username Change */
Loading

0 comments on commit c191f38

Please sign in to comment.