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


PHP set_input函数代码示例

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


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

示例1: haarlem_tangram_page_handler

/**
 * The page handler vor vacaturebank
 *
 * @param array $page url segments
 *
 * @return bool
 */
function haarlem_tangram_page_handler($page)
{
    $include_file = false;
    $pages_root = dirname(dirname(__FILE__)) . '/pages/';
    $page_owner_guid = haarlem_tangram_get_page_owner_guid();
    if (!empty($page_owner_guid)) {
        elgg_set_page_owner_guid($page_owner_guid);
    }
    switch ($page[0]) {
        case 'all':
            $include_file = "{$pages_root}all.php";
            break;
        case 'view':
            set_input('vacaturenummer', $page[1]);
            $include_file = "{$pages_root}view.php";
            break;
        default:
            forward('vacaturebank/all');
            break;
    }
    if (!empty($include_file)) {
        include $include_file;
        return true;
    }
    return false;
}
开发者ID:coldtrick,项目名称:haarlem_tangram,代码行数:33,代码来源:page_handlers.php

示例2: au_subgroups_pagehandler

function au_subgroups_pagehandler($page)
{
    // dirty check to avoid duplicate page handlers
    // since this should only be called from the route, groups hook
    if (strpos(current_page_url(), elgg_get_site_url() . 'au_subgroups') === 0) {
        return false;
    }
    switch ($page[0]) {
        case 'add':
            set_input('au_subgroup', true);
            set_input('au_subgroup_parent_guid', $page[1]);
            elgg_set_page_owner_guid($page[1]);
            echo elgg_view('resources/au_subgroups/add');
            return true;
            break;
        case 'list':
            elgg_set_page_owner_guid($page[1]);
            echo elgg_view('resources/au_subgroups/list');
            break;
        case 'delete':
            elgg_set_page_owner_guid($page[1]);
            echo elgg_view('resources/au_subgroups/delete');
            break;
        case 'openclosed':
            set_input('filter', $page[1]);
            echo elgg_view('resources/au_subgroups/openclosed');
            return true;
            break;
    }
    return false;
}
开发者ID:hypeJunction,项目名称:au_subgroups,代码行数:31,代码来源:start.php

示例3: bookmarks_page_handler

/**
 * Bookmarks page handler; allows the use of fancy URLs
 *
 * @param array $page From the page_handler function
 * @return true|false Depending on success
 */
function bookmarks_page_handler($page)
{
    // The first component of a bookmarks URL is the username
    if (isset($page[0])) {
        set_input('username', $page[0]);
    }
    // The second part dictates what we're doing
    if (isset($page[1])) {
        switch ($page[1]) {
            case "read":
                set_input('guid', $page[2]);
                @(include dirname(dirname(dirname(__FILE__))) . "/entities/index.php");
                return true;
                break;
            case "friends":
                @(include dirname(__FILE__) . "/friends.php");
                return true;
                break;
            case "inbox":
                @(include dirname(__FILE__) . "/inbox.php");
                return true;
                break;
            case "items":
                @(include dirname(__FILE__) . "/index.php");
                return true;
                break;
        }
        // If the URL is just 'bookmarks/username', or just 'bookmarks/', load the standard bookmarks index
    } else {
        @(include dirname(__FILE__) . "/index.php");
        return true;
    }
    return false;
}
开发者ID:eokyere,项目名称:elgg,代码行数:40,代码来源:start.php

示例4: notifications_page_handler

/**
 * Route page requests
 *
 * @param array $page Array of url parameters
 * @return bool
 */
function notifications_page_handler($page)
{
    elgg_gatekeeper();
    $current_user = elgg_get_logged_in_user_entity();
    // default to personal notifications
    if (!isset($page[0])) {
        $page[0] = 'personal';
    }
    if (!isset($page[1])) {
        forward("notifications/{$page[0]}/{$current_user->username}");
    }
    set_input('username', $page[1]);
    // note: $user passed in
    switch ($page[0]) {
        case 'group':
            echo elgg_view_resource('notifications/groups');
            break;
        case 'personal':
            echo elgg_view_resource('notifications/index');
            break;
        default:
            return false;
    }
    return true;
}
开发者ID:bhargavgarlapati,项目名称:Elgg,代码行数:31,代码来源:start.php

示例5: profile_manager_page_handler

/**
 * function to handle the nice urls for Custom Profile Fields
 * 
 * @param $page
 * @return unknown_type
 */
function profile_manager_page_handler($page)
{
    switch ($page[0]) {
        case "forms":
            $form = $page[1];
            if (!empty($form) && elgg_is_admin_logged_in()) {
                set_input("guid", $page[2]);
                include dirname(__FILE__) . "/pages/forms/" . $form . ".php";
                return true;
            }
            break;
        case "validate_username":
            if (elgg_is_logged_in()) {
                $new_username = get_input("username");
                $valid = false;
                if (!empty($new_username)) {
                    $valid = profile_manager_validate_username($new_username);
                }
                $result = array("valid" => $valid);
                echo json_encode($result);
                return true;
            }
            break;
        case "user_summary_control":
            include dirname(__FILE__) . "/pages/user_summary_control/preview.php";
            return true;
    }
}
开发者ID:socialweb,项目名称:PiGo,代码行数:34,代码来源:start.php

示例6: messageboard_page_handler

/**
 * Messageboard dispatcher for flat message board.
 * Profile (and eventually group) widgets handle their own.
 *
 * URLs take the form of
 *  User's messageboard:               messageboard/owner/<username>
 *  Y's history of posts on X's board: messageboard/owner/<X>/history/<Y>
 *  New post:                          messageboard/add/<guid> (container: user or group)
 *  Group messageboard:                messageboard/group/<guid>/all (not implemented)
 *
 * @param array $page Array of page elements
 * @return bool
 */
function messageboard_page_handler($page)
{
    $pages = dirname(__FILE__) . '/pages/messageboard';
    switch ($page[0]) {
        case 'owner':
            //@todo if they have the widget disabled, don't allow this.
            $owner_name = elgg_extract(1, $page);
            $owner = get_user_by_username($owner_name);
            set_input('page_owner_guid', $owner->guid);
            $history = elgg_extract(2, $page);
            $username = elgg_extract(3, $page);
            if ($history && $username) {
                set_input('history_username', $username);
            }
            include "{$pages}/owner.php";
            break;
        case 'add':
            $container_guid = elgg_extract(1, $page);
            set_input('container_guid', $container_guid);
            include "{$pages}/add.php";
            break;
        case 'group':
            elgg_group_gatekeeper();
            $owner_guid = elgg_extract(1, $page);
            set_input('page_owner_guid', $owner_guid);
            include "{$pages}/owner.php";
            break;
        default:
            return false;
    }
    return true;
}
开发者ID:ibou77,项目名称:elgg,代码行数:45,代码来源:start.php

示例7: messageboard_page_handler

/**
 * Messageboard dispatcher for flat message board.
 * Profile (and eventually group) widgets handle their own.
 *
 * URLs take the form of
 *  User's messageboard:               messageboard/owner/<username>
 *  Y's history of posts on X's board: messageboard/owner/<X>/history/<Y>
 *  New post:                          messageboard/add/<guid> (container: user or group)
 *  Group messageboard:                messageboard/group/<guid>/all (not implemented)
 *
 * @param array $page Array of page elements
 * @return bool
 */
function messageboard_page_handler($page)
{
    switch ($page[0]) {
        case 'owner':
            //@todo if they have the widget disabled, don't allow this.
            $owner_name = elgg_extract(1, $page);
            $owner = get_user_by_username($owner_name);
            set_input('page_owner_guid', $owner->guid);
            $history = elgg_extract(2, $page);
            $username = elgg_extract(3, $page);
            if ($history && $username) {
                set_input('history_username', $username);
            }
            echo elgg_view('resources/messageboard/owner');
            break;
        case 'add':
            $container_guid = elgg_extract(1, $page);
            set_input('container_guid', $container_guid);
            echo elgg_view('resources/messageboard/add');
            break;
        case 'group':
            elgg_group_gatekeeper();
            $owner_guid = elgg_extract(1, $page);
            set_input('page_owner_guid', $owner_guid);
            echo elgg_view('resources/messageboard/owner');
            break;
        default:
            return false;
    }
    return true;
}
开发者ID:elgg,项目名称:messageboard,代码行数:44,代码来源:start.php

示例8: elgg_tokeninput_explode_field_values

/**
 * Unserialize tokeninput field values before performing an action
 */
function elgg_tokeninput_explode_field_values($hook, $type, $return, $params)
{
    $elgg_tokeninput_fields = (array) get_input('elgg_tokeninput_fields', array());
    $elgg_tokneinput_autocomplete = (array) get_input('elgg_tokeninput_autocomplete', array());
    if (!empty($elgg_tokeninput_fields)) {
        foreach ($elgg_tokeninput_fields as $field_name) {
            $values = explode(',', get_input($field_name, ''));
            if (in_array($field_name, $elgg_tokneinput_autocomplete)) {
                foreach ($values as $key => $value) {
                    $user = get_entity($value);
                    if ($user instanceof ElggUser) {
                        $values[$key] = $user->username;
                    }
                }
                if (sizeof($values) === 1) {
                    $values = array_values($values)[0];
                }
            }
            set_input($field_name, $values);
        }
    }
    set_input('elgg_tokeninput_fields', null);
    set_input('elgg_tokeninput_autocomplete', null);
    return $return;
}
开发者ID:n8b,项目名称:VMN,代码行数:28,代码来源:start.php

示例9: group_tools_route_groups_handler

function group_tools_route_groups_handler($hook, $type, $return_value, $params)
{
    /**
     * $return_value contains:
     * $return_value['handler'] => requested handler
     * $return_value['segments'] => url parts ($page)
     */
    $result = $return_value;
    if (!empty($return_value) && is_array($return_value)) {
        $page = $return_value['segments'];
        switch ($page[0]) {
            case "all":
                $filter = get_input("filter");
                if (empty($filter) && ($default_filter = elgg_get_plugin_setting("group_listing", "group_tools"))) {
                    $filter = $default_filter;
                    set_input("filter", $default_filter);
                }
                if (in_array($filter, array("open", "closed", "alpha"))) {
                    // we will handle the output
                    $result = false;
                    include dirname(dirname(__FILE__)) . "/pages/groups/all.php";
                }
                break;
            case "requests":
                $result = false;
                set_input("group_guid", $page[1]);
                include dirname(dirname(__FILE__)) . "/pages/groups/membershipreq.php";
                break;
            case "invite":
                $result = false;
                set_input("group_guid", $page[1]);
                include dirname(dirname(__FILE__)) . "/pages/groups/invite.php";
                break;
            case "mail":
                $result = false;
                set_input("group_guid", $page[1]);
                include dirname(dirname(__FILE__)) . "/pages/mail.php";
                break;
            case "group_invite_autocomplete":
                $result = false;
                include dirname(dirname(__FILE__)) . "/procedures/group_invite_autocomplete.php";
                break;
            case "add":
                if (group_tools_is_group_creation_limited()) {
                    admin_gatekeeper();
                }
                break;
            default:
                // check if we have an old group profile link
                if (isset($page[0]) && is_numeric($page[0])) {
                    if (($group = get_entity($page[0])) && elgg_instanceof($group, "group", null, "ElggGroup")) {
                        register_error(elgg_echo("changebookmark"));
                        forward($group->getURL());
                    }
                }
                break;
        }
    }
    return $result;
}
开发者ID:remy40,项目名称:gvrs,代码行数:60,代码来源:hooks.php

示例10: diagnostics_page_handler

/**
 * Diagnostics page.
 *
 * @param array $page Array of page elements, forwarded by the page handling mechanism
 */
function diagnostics_page_handler($page)
{
    global $CONFIG;
    if (isset($page[0])) {
        switch ($page[0]) {
            case 'tests':
                if (isset($page[1]) && $page[1]) {
                    switch ($page[1]) {
                        case 'all':
                            break;
                        default:
                            set_input('test_func', $page[1]);
                    }
                    include $CONFIG->pluginspath . "diagnostics/testreport.php";
                } else {
                    include $CONFIG->pluginspath . "diagnostics/unittester.php";
                }
                break;
            default:
                include $CONFIG->pluginspath . "diagnostics/index.php";
        }
    } else {
        // only interested in one page for now
        include $CONFIG->pluginspath . "diagnostics/index.php";
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:start.php

示例11: profile_page_handler

/**
 * Profile page handler
 *
 * @param array $page Array of URL segments passed by the page handling mechanism
 * @return bool
 */
function profile_page_handler($page)
{
    if (isset($page[0])) {
        $username = $page[0];
        $user = get_user_by_username($username);
        elgg_set_page_owner_guid($user->guid);
    } elseif (elgg_is_logged_in()) {
        forward(elgg_get_logged_in_user_entity()->getURL());
    }
    // short circuit if invalid or banned username
    if (!$user || $user->isBanned() && !elgg_is_admin_logged_in()) {
        register_error(elgg_echo('profile:notfound'));
        forward();
    }
    $action = NULL;
    if (isset($page[1])) {
        $action = $page[1];
    }
    if ($action == 'edit') {
        // use the core profile edit page
        echo elgg_view_resource('profile/edit');
        return true;
    }
    set_input('username', $page[0]);
    echo elgg_view_resource('profile/view');
    return true;
}
开发者ID:bhargavgarlapati,项目名称:Elgg,代码行数:33,代码来源:start.php

示例12: news_page_handler

function news_page_handler($segments)
{
    switch ($segments[0]) {
        case "add":
            include dirname(__FILE__) . "/pages/edit.php";
            break;
        case "edit":
            set_input('guid', $segments[1]);
            include dirname(__FILE__) . "/pages/edit.php";
            break;
        case "view":
            set_input('guid', $segments[1]);
            include dirname(__FILE__) . "/pages/view.php";
            break;
        case "photo":
            set_input('guid', $segments[1]);
            include dirname(__FILE__) . "/pages/photo.php";
            break;
        case "all":
        default:
            include dirname(__FILE__) . "/pages/all.php";
            break;
    }
    return true;
}
开发者ID:pleio,项目名称:news,代码行数:25,代码来源:start.php

示例13: blog

 /**
  * Listen to the blog page handler, to takeover some pages
  *
  * @param string $hook         'route'
  * @param string $type         'blog'
  * @param array  $return_value the current page_handler params
  * @param null   $params       null
  *
  * @return void|false
  */
 public static function blog($hook, $type, $return_value, $params)
 {
     $page = elgg_extract('segments', $return_value);
     if (empty($page)) {
         return;
     }
     $include_file = false;
     $resouce_loaded = false;
     $pages_path = elgg_get_plugins_path() . 'blog_tools/pages/';
     switch ($page[0]) {
         case 'read':
             // Elgg 1.7 compatibility
         // Elgg 1.7 compatibility
         case 'view':
             set_input('guid', $page[1]);
             // to be used in the blog_tools/full/related view
             break;
         case 'featured':
             $resouce_loaded = true;
             echo elgg_view_resource('blog_tools/blog/featured');
             break;
     }
     if (!empty($resouce_loaded)) {
         return false;
     } elseif (!empty($include_file)) {
         include $include_file;
         return false;
     }
 }
开发者ID:coldtrick,项目名称:blog_tools,代码行数:39,代码来源:Router.php

示例14: zhgroups_page_handler

function zhgroups_page_handler($page)
{
    $result = false;
    switch ($page[0]) {
        case 'find':
            include dirname(dirname(__FILE__)) . "/pages/find.php";
            break;
        case 'topic':
            include dirname(dirname(__FILE__)) . "/pages/topic.php";
            break;
        case "mail":
            set_input("group_guid", $page[1]);
            include dirname(dirname(__FILE__)) . "/pages/mail.php";
            break;
        case "members":
            set_input("group_guid", $page[1]);
            include dirname(dirname(__FILE__)) . "/pages/members.php";
            break;
        case "contact":
            set_input("group_guid", $page[1]);
            include dirname(dirname(__FILE__)) . "/pages/contact.php";
            break;
        case "invite":
            set_input("group_guid", $page[1]);
            include dirname(dirname(__FILE__)) . "/pages/invite.php";
            break;
        case "notifications":
            zhgroups_toggle_notifications();
            break;
        case "emUnsub":
            zhgroupsUnsub();
            break;
    }
    return $result;
}
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:35,代码来源:hooks.php

示例15: hflts_page_handler

function hflts_page_handler($page)
{
    if (elgg_extract(0, $page) === 'collective') {
        $content = elgg_view('hflts/collective', array('nAlternativas' => $page[1], 'nCriterios' => $page[2], 'nExpertos' => $page[3], 'G' => $page[4], 'import_file' => $page[5], 'weight_file' => $page[6]));
        $params = array('title' => 'DM con datos de samples/set_' . $page[5] . '.csv (' . $page[6] . ')', 'content' => $content, 'filter' => '');
        $body = elgg_view_layout('content', $params);
        echo elgg_view_page('hflts', $body);
        return true;
    }
    set_input('username', $page[0]);
    //necesario
    $user = elgg_get_page_owner_entity();
    // ej strem
    $guid = elgg_get_page_owner_guid();
    // id de strem
    //aqui es donde tengo que filtrar por guid como en https://elgg.org/discussion/view/2268999/doubt-in-elgg-get-entities-from-metadata
    $valorations = elgg_get_entities_from_metadata(['type' => 'object', 'subtype' => 'evaluation_content', 'metadata_name_value_pairs' => array('name' => 'user_guid', 'value' => $guid), 'limit' => $vars['entity']->num_display, 'pagination' => false, 'order_by_metadata' => ['name' => 'state', 'direction' => 'ASC', 'as' => 'text']]);
    if (!$valorations) {
        $valorations = '<p class="mtm">' . elgg_echo('evaluationcontent:none') . '</p>';
    }
    $content = elgg_view('hflts/driver', array('valorations' => $valorations));
    $params = array('title' => 'Valoraciones de ' . $user->name, 'content' => $content, 'filter' => '');
    $body = elgg_view_layout('content', $params);
    echo elgg_view_page('hflts', $body);
}
开发者ID:rosanamontes,项目名称:teranga.go,代码行数:25,代码来源:start.php


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