当前位置: 首页>>代码示例>>PHP>>正文


PHP elgg_clear_sticky_form函数代码示例

本文整理汇总了PHP中elgg_clear_sticky_form函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_clear_sticky_form函数的具体用法?PHP elgg_clear_sticky_form怎么用?PHP elgg_clear_sticky_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了elgg_clear_sticky_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elgg_make_sticky_form

 /**
  * Load all the REQUEST variables into the sticky form cache
  *
  * Call this from an action when you want all your submitted variables
  * available if the submission fails validation and is sent back to the form
  */
 function elgg_make_sticky_form()
 {
     elgg_clear_sticky_form();
     $_SESSION['sticky'] = array();
     foreach ($_REQUEST as $key => $var) {
         // will go through XSS filtering on the get function
         $_SESSION['sticky'][$key] = get_input($key);
     }
 }
开发者ID:CashElgg,项目名称:stickyforms,代码行数:15,代码来源:start.php

示例2: makeStickyForm

 /**
  * Load all the GET and POST variables into the sticky form cache
  *
  * Call this from an action when you want all your submitted variables
  * available if the submission fails validation and is sent back to the form
  *
  * @param string $form_name Name of the sticky form
  *
  * @return void
  */
 public function makeStickyForm($form_name)
 {
     elgg_clear_sticky_form($form_name);
     $session = _elgg_services()->session;
     $data = $session->get('sticky_forms', array());
     $req = _elgg_services()->request;
     // will go through XSS filtering in elgg_get_sticky_value()
     $vars = array_merge($req->query->all(), $req->request->all());
     $data[$form_name] = $vars;
     $session->set('sticky_forms', $data);
 }
开发者ID:thehereward,项目名称:Elgg,代码行数:21,代码来源:StickyForms.php

示例3: 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;
}
开发者ID:duanhv,项目名称:mdg-social,代码行数:17,代码来源:messages.php

示例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;
}
开发者ID:ibou77,项目名称:elgg,代码行数:22,代码来源:messages.php

示例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;
}
开发者ID:nirajkaushal,项目名称:Elgg,代码行数:52,代码来源:groups.php

示例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;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:25,代码来源:scheduling.php

示例7: 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;
}
开发者ID:hejosadi,项目名称:PiGo-LMS,代码行数:25,代码来源:answers.php

示例8: 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;
}
开发者ID:duanhv,项目名称:mdg-social,代码行数:25,代码来源:golfscore.php

示例9: 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;
}
开发者ID:akudan,项目名称:elgg-markdown_wiki,代码行数:25,代码来源:utilities.php

示例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;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:26,代码来源:videos.php

示例11: 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;
}
开发者ID:elgg,项目名称:groups,代码行数:26,代码来源:discussion.php

示例12: pages_prepare_form_vars

/**
 * Prepare the add/edit form variables
 *
 * @param ElggObject $page
 * @return array
 */
function pages_prepare_form_vars($page = null, $parent_guid = 0)
{
    // input names => defaults
    $values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $page, 'parent_guid' => $parent_guid);
    if ($page) {
        foreach (array_keys($values) as $field) {
            if (isset($page->{$field})) {
                $values[$field] = $page->{$field};
            }
        }
    }
    if (elgg_is_sticky_form('page')) {
        $sticky_values = elgg_get_sticky_values('page');
        foreach ($sticky_values as $key => $value) {
            $values[$key] = $value;
        }
    }
    elgg_clear_sticky_form('page');
    return $values;
}
开发者ID:rcolomoc,项目名称:Master-Red-Social,代码行数:26,代码来源:pages.php

示例13: 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;
}
开发者ID:nachopavon,项目名称:elgg-sched_conf-plugin,代码行数:26,代码来源:model.php

示例14: 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;
}
开发者ID:nlybe,项目名称:elgg-news,代码行数:26,代码来源:amapnews.php

示例15: 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;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:26,代码来源:tasks.php


注:本文中的elgg_clear_sticky_form函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。