本文整理汇总了PHP中elgg_is_sticky_form函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_is_sticky_form函数的具体用法?PHP elgg_is_sticky_form怎么用?PHP elgg_is_sticky_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_is_sticky_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: messages_prepare_form_vars
/**
* Prepare the compose form variables
*
* @return array
*/
function messages_prepare_form_vars($recipient_guid = 0)
{
// input names => defaults
$values = array('subject' => '', 'body' => '', 'recipient_guid' => $recipient_guid);
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
$values[$field] = elgg_get_sticky_value('messages', $field);
}
}
elgg_clear_sticky_form('messages');
return $values;
}
示例2: prepare
/**
*
*/
public function prepare($entity = null)
{
// name => value
$fields = array('guid' => null, 'title' => null, 'description' => null, 'owner_guid' => null, 'container_guid' => null, 'access_id' => ACCESS_PUBLIC, 'page' => null);
if ($entity) {
foreach ($fields as $name => $value) {
$fields[$name] = $entity->{$name};
}
}
if (elgg_is_sticky_form('tour_page')) {
// TODO
}
return $fields;
}
示例3: pool_prepare_form_vars
/**
* Pull together variables for the save form
*
* @param Pool $entity Pool object
* @return array $values Array of form values
*/
function pool_prepare_form_vars($entity = null)
{
$values = array('guid' => null, 'title' => null, 'description' => null, 'interval' => null, 'interval_time' => null, 'time' => null, 'access_id' => null, 'owner_guid' => null, 'container_guid' => null);
if ($entity) {
foreach ($values as $name => $value) {
$values[$name] = $entity->{$name};
}
}
if (elgg_is_sticky_form('task_pool')) {
$sticky_values = elgg_get_sticky_values('task_pool');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('task_pool');
return $values;
}
示例4: messages_prepare_form_vars
/**
* Prepare the compose form variables
*
* @return array
*/
function messages_prepare_form_vars($recipient_guid = 0)
{
$recipient_username = '';
$recipient = get_entity($recipient_guid);
if (elgg_instanceof($recipient, 'user')) {
$recipient_username = $recipient->username;
}
// input names => defaults
$values = array('subject' => '', 'body' => '', 'recipient_username' => $recipient_username);
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
$values[$field] = elgg_get_sticky_value('messages', $field);
}
}
elgg_clear_sticky_form('messages');
return $values;
}
示例5: groups_prepare_form_vars
/**
* Prepares variables for the group edit form view.
*
* @param mixed $group ElggGroup or null. If a group, uses values from the group.
* @return array
*/
function groups_prepare_form_vars($group = null)
{
$values = array('name' => '', 'membership' => ACCESS_PUBLIC, 'vis' => ACCESS_PUBLIC, 'guid' => null, 'entity' => null, 'owner_guid' => elgg_get_logged_in_user_guid(), 'content_access_mode' => ElggGroup::CONTENT_ACCESS_MODE_UNRESTRICTED);
// handle customizable profile fields
$fields = elgg_get_config('group');
if ($fields) {
foreach ($fields as $name => $type) {
$values[$name] = '';
}
}
// handle tool options
$tools = elgg_get_config('group_tool_options');
if ($tools) {
foreach ($tools as $group_option) {
$option_name = $group_option->name . "_enable";
$values[$option_name] = $group_option->default_on ? 'yes' : 'no';
}
}
// get current group settings
if ($group) {
foreach (array_keys($values) as $field) {
if (isset($group->{$field})) {
$values[$field] = $group->{$field};
}
}
if ($group->access_id != ACCESS_PUBLIC && $group->access_id != ACCESS_LOGGED_IN) {
// group only access - this is done to handle access not created when group is created
$values['vis'] = ACCESS_PRIVATE;
} else {
$values['vis'] = $group->access_id;
}
// The content_access_mode was introduced in 1.9. This method must be
// used for backwards compatibility with groups created before 1.9.
$values['content_access_mode'] = $group->getContentAccessMode();
$values['entity'] = $group;
}
// get any sticky form settings
if (elgg_is_sticky_form('groups')) {
$sticky_values = elgg_get_sticky_values('groups');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('groups');
return $values;
}
示例6: scheduling_prepare_form_vars
/**
* Pull together variables for the save form
*
* @param ElggEntity $schedule
* @return array $values
*/
function scheduling_prepare_form_vars(ElggEntity $schedule = null)
{
$values = array('guid' => 0, 'title' => '', 'description' => '', 'owner_guid' => elgg_get_logged_in_user_guid(), 'container_guid' => 0, 'access_id' => ACCESS_PUBLIC);
if ($schedule) {
foreach ($values as $field => $value) {
if (isset($schedule->{$field})) {
$values[$field] = $schedule->{$field};
}
}
}
if (elgg_is_sticky_form('scheduling')) {
$sticky_values = elgg_get_sticky_values('scheduling');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('scheduling');
return $values;
}
示例7: markdown_wiki_group_settings_prepare_form_vars
/**
* Prepare the group settings form variables
*
* @param ElggObject $group A group object.
* @return array
*/
function markdown_wiki_group_settings_prepare_form_vars($group = null)
{
$values = array('markdown_wiki_all_enabled' => get_input('markdown_wiki_all_enabled', false));
if ($group) {
foreach (array_keys($values) as $field) {
if (isset($group->{$field})) {
$values[$field] = $group->{$field};
}
}
}
if (elgg_is_sticky_form('markdown_wiki_settings')) {
$sticky_values = elgg_get_sticky_values('markdown_wiki_settings');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('markdown_wiki_settings');
return $values;
}
示例8: answers_prepare_form_vars
/**
* Prepare the add/edit form variables
*
* @param ElggObject $question A question object.
* @return array
*/
function answers_prepare_form_vars($question = null)
{
$values = array('title' => get_input('search', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $question);
if ($question) {
foreach (array_keys($values) as $field) {
if (isset($question->{$field})) {
$values[$field] = $question->{$field};
}
}
}
if (elgg_is_sticky_form('question')) {
$sticky_values = elgg_get_sticky_values('question');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('question');
return $values;
}
示例9: golfscore_prepare_form_vars
/**
* Prepare the add/edit form variables
*
* @param ElggObject $golfscore golfscore object.
* @return array
*/
function golfscore_prepare_form_vars($golfscore = null)
{
$values = array('title' => get_input('title', ''), 'address' => get_input('address', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'shares' => array(), 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $golfscore);
if ($golfscore) {
foreach (array_keys($values) as $field) {
if (isset($golfscore->{$field})) {
$values[$field] = $golfscore->{$field};
}
}
}
if (elgg_is_sticky_form('golfscore')) {
$sticky_values = elgg_get_sticky_values('golfscore');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('golfscore');
return $values;
}
示例10: videos_prepare_form_vars
/**
* Prepare the add/edit form variables
*
* @param ElggObject $video A video object.
* @return array
*/
function videos_prepare_form_vars($video = null)
{
// input names => defaults
$values = array('title' => get_input('title', ''), 'video_url' => get_input('video_url', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $video);
if ($video) {
foreach (array_keys($values) as $field) {
if (isset($video->{$field})) {
$values[$field] = $video->{$field};
}
}
}
if (elgg_is_sticky_form('videos')) {
$sticky_values = elgg_get_sticky_values('videos');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('videos');
return $values;
}
示例11: tasks_prepare_form_vars
/**
* Prepare the add/edit form variables
*
* @param ElggObject $task
* @return array
*/
function tasks_prepare_form_vars($task = null, $parent_guid = 0)
{
// input names => defaults
$values = array('title' => '', 'description' => '', 'start_date' => '', 'end_date' => '', 'task_type' => '', 'status' => '', 'assigned_to' => '', 'percent_done' => '', 'work_remaining' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $task, 'parent_guid' => $parent_guid);
if ($task) {
foreach (array_keys($values) as $field) {
if (isset($task->{$field})) {
$values[$field] = $task->{$field};
}
}
}
if (elgg_is_sticky_form('task')) {
$sticky_values = elgg_get_sticky_values('task');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('task');
return $values;
}
示例12: sched_conf_prepare_edit_form_vars
/**
* Pull together variables for the edit form
*
* @param ElggObject $event
* @return array
*/
function sched_conf_prepare_edit_form_vars($conf = NULL)
{
// input names => defaults
$values = array('title' => NULL, 'description' => NULL, 'application' => NULL, 'application_code' => NULL, 'immediate' => NULL, 'start_date' => NULL, 'start_time_h' => NULL, 'start_time_m' => NULL, 'tags' => NULL, 'access_id' => ACCESS_DEFAULT, 'group_guid' => NULL, 'guid' => NULL, 'start_time' => NULL);
if ($conf) {
foreach (array_keys($values) as $field) {
if (isset($conf->{$field})) {
$values[$field] = $conf->{$field};
}
}
}
if (elgg_is_sticky_form('sched_conf')) {
$sticky_values = elgg_get_sticky_values('sched_conf');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('sched_conf');
return $values;
}
示例13: amapnews_prepare_form_vars
/**
* Add amapnews form parameters
*
* @param type $entity_unit
* @return type
*/
function amapnews_prepare_form_vars($entity_unit = null)
{
// input names => defaults
$values = array('title' => '', 'description' => '', 'excerpt' => '', 'featured' => '', 'photo' => '', 'tags' => '', 'connected_guid' => null, 'access_id' => ACCESS_DEFAULT, 'container_guid' => elgg_get_page_owner_guid(), 'entity' => $entity_unit, 'guid' => null, 'comments_on' => NULL);
if ($entity_unit) {
foreach (array_keys($values) as $field) {
if (isset($entity_unit->{$field})) {
$values[$field] = $entity_unit->{$field};
}
}
}
if (elgg_is_sticky_form('amapnews')) {
$sticky_values = elgg_get_sticky_values('amapnews');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('amapnews');
return $values;
}
示例14: discussion_prepare_form_vars
/**
* Prepare discussion topic form variables
*
* @param ElggObject $topic Topic object if editing
* @return array
*/
function discussion_prepare_form_vars($topic = NULL)
{
// input names => defaults
$values = array('title' => '', 'description' => '', 'status' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'topic' => $topic);
if ($topic) {
foreach (array_keys($values) as $field) {
if (isset($topic->{$field})) {
$values[$field] = $topic->{$field};
}
}
}
if (elgg_is_sticky_form('topic')) {
$sticky_values = elgg_get_sticky_values('topic');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('topic');
return $values;
}
示例15: sharemaps_prepare_form_vars_drawmap
/**
* Prepare the map creation form variables
*
* @param type $drawmap
* @return type
*/
function sharemaps_prepare_form_vars_drawmap($drawmap = null)
{
// input names => defaults
$values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'dm_markers' => '', 'entity' => $drawmap);
if ($drawmap) {
foreach (array_keys($values) as $field) {
if (isset($drawmap->{$field})) {
$values[$field] = $drawmap->{$field};
}
}
}
if (elgg_is_sticky_form('drawmap')) {
$sticky_values = elgg_get_sticky_values('drawmap');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
elgg_clear_sticky_form('drawmap');
return $values;
}