make activities optional for profile things, clean up the forms
This commit is contained in:
parent
1ca85abf83
commit
2c1b366fdf
@ -19,6 +19,7 @@ function thing_init(&$a) {
|
|||||||
|
|
||||||
$name = escape_tags($_REQUEST['term']);
|
$name = escape_tags($_REQUEST['term']);
|
||||||
$verb = escape_tags($_REQUEST['verb']);
|
$verb = escape_tags($_REQUEST['verb']);
|
||||||
|
$activity = intval($_REQUEST['activity']);
|
||||||
$profile_guid = escape_tags($_REQUEST['profile_assign']);
|
$profile_guid = escape_tags($_REQUEST['profile_assign']);
|
||||||
$url = $_REQUEST['link'];
|
$url = $_REQUEST['link'];
|
||||||
$photo = $_REQUEST['img'];
|
$photo = $_REQUEST['img'];
|
||||||
@ -160,6 +161,8 @@ function thing_init(&$a) {
|
|||||||
|
|
||||||
info( t('Thing added'));
|
info( t('Thing added'));
|
||||||
|
|
||||||
|
|
||||||
|
if($activity) {
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $term['url']));
|
$links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $term['url']));
|
||||||
if($local_photo)
|
if($local_photo)
|
||||||
@ -213,7 +216,7 @@ function thing_init(&$a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret = post_activity_item($arr);
|
$ret = post_activity_item($arr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -269,6 +272,7 @@ function thing_content(&$a) {
|
|||||||
'$profile_select' => contact_profile_assign($r[0]['obj_page']),
|
'$profile_select' => contact_profile_assign($r[0]['obj_page']),
|
||||||
'$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'),
|
'$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'),
|
||||||
'$verb_select' => obj_verb_selector($r[0]['obj_verb']),
|
'$verb_select' => obj_verb_selector($r[0]['obj_verb']),
|
||||||
|
'$activity' => array('activity',t('Post an activity'),true,t('Only sends to viewers of the applicable profile')),
|
||||||
'$thing_hash' => $thing_hash,
|
'$thing_hash' => $thing_hash,
|
||||||
'$thing_lbl' => t('Name of thing e.g. something'),
|
'$thing_lbl' => t('Name of thing e.g. something'),
|
||||||
'$thething' => $r[0]['term'],
|
'$thething' => $r[0]['term'],
|
||||||
@ -314,6 +318,7 @@ function thing_content(&$a) {
|
|||||||
'$profile_lbl' => t('Select a profile'),
|
'$profile_lbl' => t('Select a profile'),
|
||||||
'$profile_select' => contact_profile_assign(''),
|
'$profile_select' => contact_profile_assign(''),
|
||||||
'$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'),
|
'$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'),
|
||||||
|
'$activity' => array('activity',t('Post an activity'),true,t('Only sends to viewers of the applicable profile')),
|
||||||
'$verb_select' => obj_verb_selector(),
|
'$verb_select' => obj_verb_selector(),
|
||||||
'$thing_lbl' => t('Name of thing e.g. something'),
|
'$thing_lbl' => t('Name of thing e.g. something'),
|
||||||
'$url_lbl' => t('URL of thing (optional)'),
|
'$url_lbl' => t('URL of thing (optional)'),
|
||||||
|
@ -4,22 +4,16 @@
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thing-verb-label {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thing-verb {
|
.thing-label, .field label, .thing-verb-label, .thing-profile-label{
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thing-label {
|
|
||||||
float: left;
|
float: left;
|
||||||
width: 250px;
|
width: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thing-input {
|
.thing-input, .thing-verb, .thing-profile{
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thing-field-end {
|
.thing-field-end {
|
||||||
|
@ -6,11 +6,13 @@
|
|||||||
<div class="thing-profile-label">{{$profile_lbl}}</div>
|
<div class="thing-profile-label">{{$profile_lbl}}</div>
|
||||||
|
|
||||||
<div class="thing-profile">{{$profile_select}}</div>
|
<div class="thing-profile">{{$profile_select}}</div>
|
||||||
|
<div class="thing-field-end"></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="thing-verb-label">{{$verb_lbl}}</div>
|
<div class="thing-verb-label">{{$verb_lbl}}</div>
|
||||||
|
|
||||||
<div class="thing-verb">{{$verb_select}}</div>
|
<div class="thing-verb">{{$verb_select}}</div>
|
||||||
|
<div class="thing-field-end"></div>
|
||||||
|
|
||||||
|
|
||||||
<label class="thing-label" for="thing-term">{{$thing_lbl}}</label>
|
<label class="thing-label" for="thing-term">{{$thing_lbl}}</label>
|
||||||
@ -23,6 +25,8 @@
|
|||||||
<input type="text" class="thing-input" id="thing-img" name="img" value="{{$imgurl}}" />
|
<input type="text" class="thing-input" id="thing-img" name="img" value="{{$imgurl}}" />
|
||||||
<div class="thing-field-end"></div>
|
<div class="thing-field-end"></div>
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$activity}}
|
||||||
|
|
||||||
<div class="thing-end"></div>
|
<div class="thing-end"></div>
|
||||||
|
|
||||||
<input type="submit" class="thing-submit" name="submit" value="{{$submit}}" />
|
<input type="submit" class="thing-submit" name="submit" value="{{$submit}}" />
|
||||||
|
@ -5,11 +5,14 @@
|
|||||||
<div class="thing-profile-label">{{$profile_lbl}}</div>
|
<div class="thing-profile-label">{{$profile_lbl}}</div>
|
||||||
|
|
||||||
<div class="thing-profile">{{$profile_select}}</div>
|
<div class="thing-profile">{{$profile_select}}</div>
|
||||||
|
<div class="thing-field-end"></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
<div class="thing-verb-label">{{$verb_lbl}}</div>
|
<div class="thing-verb-label">{{$verb_lbl}}</div>
|
||||||
|
|
||||||
<div class="thing-verb">{{$verb_select}}</div>
|
<div class="thing-verb">{{$verb_select}}</div>
|
||||||
|
<div class="thing-field-end"></div>
|
||||||
|
|
||||||
|
|
||||||
<label class="thing-label" for="thing-term">{{$thing_lbl}}</label>
|
<label class="thing-label" for="thing-term">{{$thing_lbl}}</label>
|
||||||
@ -22,6 +25,8 @@
|
|||||||
<input type="text" class="thing-input" id="thing-img" name="img" />
|
<input type="text" class="thing-input" id="thing-img" name="img" />
|
||||||
<div class="thing-field-end"></div>
|
<div class="thing-field-end"></div>
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$activity}}
|
||||||
|
|
||||||
<div class="thing-end"></div>
|
<div class="thing-end"></div>
|
||||||
|
|
||||||
<input type="submit" class="thing-submit" name="submit" value="{{$submit}}" />
|
<input type="submit" class="thing-submit" name="submit" value="{{$submit}}" />
|
||||||
|
Reference in New Issue
Block a user