Skip to content

Commit

Permalink
Merge branch 'master' into harijari
Browse files Browse the repository at this point in the history
  • Loading branch information
gdud committed Dec 12, 2011
2 parents 0b55f87 + fd76bc9 commit fb10ceb
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 41 deletions.
67 changes: 34 additions & 33 deletions sites/all/modules/housemedia/hm_credit_form/hm_credit_form.module
Expand Up @@ -12,25 +12,26 @@ function hm_credit_form_node_grants($account, $op) {

function hm_credit_form_node_access_records($node) {
$grants = array();

$grants[] = array(
'realm' => 'credit_form',
'gid' => $node->uid,
'grant_view' => TRUE,
'grant_update' => FALSE,
'grant_delete' => FALSE,
'priority' => 0,
);

$grants[] = array(
'realm' => 'credit_form',
'gid' => $node->field_credit_form_advisor[0]['uid'],
'grant_view' => TRUE,
'grant_update' => ($node->_workflow < 6),
'grant_delete' => FALSE,
'priority' => 0,
);


if ($node->type == 'hm_credit_form') {
$grants[] = array(
'realm' => 'credit_form',
'gid' => $node->uid,
'grant_view' => TRUE,
'grant_update' => FALSE,
'grant_delete' => FALSE,
'priority' => 0,
);

$grants[] = array(
'realm' => 'credit_form',
'gid' => $node->field_credit_form_advisor[0]['uid'],
'grant_view' => TRUE,
'grant_update' => ($node->_workflow < 6),
'grant_delete' => FALSE,
'priority' => 0,
);
}
return $grants;
}

Expand All @@ -49,7 +50,7 @@ function hm_credit_form_block($op = 'list', $delta = 0, $edit = array()) {
function hm_credit_form_form_alter(&$form, $form_state, $form_id) {

if ($form_id == 'user_relationships_ui_request') {

$rtype = user_relationships_type_load($form['rtid']['#default_value']);

if (!hm_credit_form_can_create_relationship($form['requester']['#value'], $form['requestee']['#value'])) {
Expand All @@ -60,16 +61,16 @@ function hm_credit_form_form_alter(&$form, $form_state, $form_id) {
if ($rtype->name != 'advisor') {
return;
}

// Extend form.
$weight = -20;
foreach (hm_credit_form_fields() as $field) {

// Not include 'Advisor' field.
if ($field['field_name'] == 'field_credit_form_advisor') {
continue;
}

$form[$field['field_name']] = array(
'#title' => $field['widget']['label'],
'#type' => str_replace('text_', '', $field['widget']['type']),
Expand All @@ -81,15 +82,15 @@ function hm_credit_form_form_alter(&$form, $form_state, $form_id) {
global $user;

$profile = content_profile_load('uzytkownik', $user->uid);

if ($profile) {
$form['field_credit_form_name']['#default_value'] = $profile->field_imie[0]['value'];
$form['field_credit_form_surname']['#default_value'] = $profile->field_nazwisko[0]['value'];
}

$form['elaboration']['#access'] = FALSE;
$form['#redirect'] = 'user/'. $user->uid;

$form['#redirect'] = 'user/'. $user->uid;
}

if ($form_id == 'credit_form_node_form') {
Expand All @@ -111,7 +112,7 @@ function hm_credit_form_can_create_relationship($requester, $receiver) {
));

return empty($relationship) &&
user_relationships_api_can_request($requester, _hm_credit_form_rtid()) &&
user_relationships_api_can_request($requester, _hm_credit_form_rtid()) &&
user_relationships_api_can_receive($receiver, _hm_credit_form_rtid());
}

Expand All @@ -129,35 +130,35 @@ function hm_credit_form_user_relationships($op, &$relationship) {
$node = new stdClass;
$node->type = 'credit_form';
$node->uid = $relationship->requester->uid;

foreach (hm_credit_form_fields() as $field) {
$name = $field['field_name'];
$node->{$name}[0]['value'] = $relationship->{$name};
}

$node->field_credit_form_advisor[0]['uid'] = $relationship->requestee->uid;
$node->sticky = 1;
$node->title = t('Credit form:');
$node->title .= ' '. $node->field_credit_form_name[0]['value'];
$node->title .= ' '. $node->field_credit_form_surname[0]['value'];
$node->title .= ' ('. $relationship->requester->name .')';

node_save($node);
}
}


function hm_credit_form_fields() {

$content_fields = content_fields();
$fields = array();

foreach ($content_fields as $field) {
if ($field['type_name'] == 'credit_form') {
$fields[] = $field;
}
}

return $fields;
}

Expand Down
2 changes: 1 addition & 1 deletion sites/all/themes/housemedia/css/housemedia.css

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions sites/all/themes/housemedia/css/raw/_blocks.scss
Expand Up @@ -146,6 +146,10 @@
#block-views-hm_group_featured-block_1 {
@include block-gray-background;

.title {
background: url(../img/promowane.png) no-repeat 6px center #5D91C0;
padding-left: 35px;
}
.jcarousel-skin-default {
.jcarousel-container-horizontal {
height: 100px;
Expand All @@ -168,14 +172,14 @@
}
}
.jcarousel-prev-horizontal {
background: $color-azure;
background: url(../img/carousel-left.png) no-repeat 0 center #e6eef5;
height: 100px;
left: 0;
top: 0;
width: 22px;
}
.jcarousel-next-horizontal {
background: $color-azure;
background: url(../img/carousel-right.png) no-repeat right center #e6eef5;
height: 100px;
right: 0;
top: 0;
Expand Down Expand Up @@ -362,11 +366,6 @@
padding-left: 35px;
}

#block-views-hm_group_featured-block_1 .title {
background: url(../img/promowane.png) no-repeat 6px center #5D91C0;
padding-left: 35px;
}

#block-views-hm_promotion_last-block_1 .title {
background: url(../img/promocje.png) no-repeat 6px center #5D91C0;
padding-left: 35px;
Expand Down
Binary file added sites/all/themes/housemedia/img/carousel-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sites/all/themes/housemedia/img/carousel-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sites/all/themes/housemedia/img/header-icon1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sites/all/themes/housemedia/img/header-icon2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sites/all/themes/housemedia/img/header-icon3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sites/all/themes/housemedia/img/ranking.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fb10ceb

Please sign in to comment.