本文整理汇总了PHP中set_input函数的典型用法代码示例。如果您正苦于以下问题:PHP set_input函数的具体用法?PHP set_input怎么用?PHP set_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_input函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: saml
/**
* The page handler for all saml/ pages
*
* @param array $page the array of the different page elements
*
* @return bool
*/
public static function saml($page)
{
$pages_path = elgg_get_plugins_path() . 'simplesaml/pages/';
$include_file = false;
switch ($page[0]) {
case 'login':
if (!empty($page[1])) {
set_input('saml_source', $page[1]);
}
$include_file = "{$pages_path}login.php";
break;
case 'no_linked_account':
if (!empty($page[1])) {
set_input('saml_source', $page[1]);
}
$include_file = "{$pages_path}no_linked_account.php";
break;
case 'authorize':
if (!empty($page[1])) {
set_input('saml_source', $page[1]);
}
$include_file = "{$pages_path}authorize.php";
break;
case 'idp_login':
$include_file = "{$pages_path}idp_login.php";
break;
}
if (!empty($include_file)) {
include $include_file;
return true;
}
return false;
}
开发者ID:coldtrick,项目名称:simplesaml,代码行数:40,代码来源:PageHandler.php
示例17: page_handler
/**
* Serve pages. URLs in the form:
*
* pg/block_users/blocked_users/<username> - Users blocked by <username>. If not set, defaults to logged in.
* pg/block_users/blocked - The page to display when a user is blocked.
*
* @param array $page
* @return bool Depending on success
*/
function page_handler($page)
{
gatekeeper();
if (!isset($page[0])) {
$page[0] = 'blocked_users';
}
switch ($page[0]) {
case 'blocked_user_content':
$site = elgg_get_site_entity();
elgg_set_page_owner_guid($site->guid);
include dirname(__FILE__) . '/pages/block_users/blocked_user_content.php';
break;
case 'blocked_content':
$site = elgg_get_site_entity();
elgg_set_page_owner_guid($site->guid);
include dirname(__FILE__) . '/pages/block_users/blocked_content.php';
break;
default:
case 'blocked_users':
$logged_in_user = elgg_get_logged_in_user_entity();
if (!isset($page[1])) {
$page[1] = $logged_in_user->username;
}
set_input('blocking_username', $page[1]);
// only admins can see another user's block list
if ($page[1] != $logged_in_user->username) {
admin_gatekeeper();
}
include dirname(__FILE__) . '/pages/block_users/blocked_users.php';
}
return true;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:41,代码来源:start.php
示例18: wizard_page_handler
/**
* Handle /wizard
*
* @param array $page url elements
*
* @return bool
*/
function wizard_page_handler($page)
{
$include_file = false;
$pages_base = elgg_get_plugins_path() . 'wizard/pages/';
switch ($page[0]) {
case 'view':
if (!empty($page[1]) && is_numeric($page[1])) {
set_input('guid', $page[1]);
$include_file = "{$pages_base}view.php";
}
break;
default:
// try to find a wizard
if (!empty($page[0])) {
$options = array('type' => 'object', 'subtype' => Wizard::SUBTYPE, 'limit' => 1, 'metadata_name_value_pairs' => array('friendly_title' => $page[0]));
$entities = elgg_get_entities_from_metadata($options);
if (!empty($entities)) {
set_input('guid', $entities[0]->getGUID());
$include_file = "{$pages_base}view.php";
}
}
break;
}
if (!empty($include_file)) {
include $include_file;
return true;
}
return false;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:36,代码来源:page_handlers.php
示例19: odt_editor_page_handler
/**
* Dispatches odt_editor pages.
* URLs take the form of
* Save as: odt_editor/saveas/<guid>
*
* @param array $page
* @return bool
*/
function odt_editor_page_handler($page)
{
$odt_editor_pages_dir = elgg_get_plugins_path() . 'odt_editor/pages';
$page_type = $page[0];
switch ($page_type) {
case 'saveas':
set_input('guid', $page[1]);
include "{$odt_editor_pages_dir}/odt_editor/saveas.php";
break;
case 'create':
$container = get_entity($page[1]);
if (!$container) {
$container = get_loggedin_userid();
}
// show new document in WebODF editor page
// 0 as indicator for new document
set_input('guid', 0);
set_input('container_guid', $page[1]);
include "{$odt_editor_pages_dir}/file/odt_editor.php";
$result = false;
break;
case 'gettemplate':
include "{$odt_editor_pages_dir}/odt_editor/gettemplate.php";
break;
default:
return false;
}
return true;
}
开发者ID:pleio,项目名称:odt_editor,代码行数:37,代码来源:page_handlers.php
示例20: pages_tools_route_pages_hook
function pages_tools_route_pages_hook($hook, $type, $return_value, $params)
{
$result = $return_value;
if (!empty($return_value) && is_array($return_value)) {
$page = elgg_extract("segments", $result);
switch ($page[0]) {
case "export":
if (isset($page[1])) {
$result = false;
set_input("page_guid", $page[1]);
include dirname(dirname(__FILE__)) . "/pages/export.php";
}
break;
case "view":
$result = false;
set_input("guid", $page[1]);
include dirname(dirname(__FILE__)) . "/pages/pages/view.php";
break;
case "owner":
$result = false;
include dirname(dirname(__FILE__)) . "/pages/pages/owner.php";
break;
case "friends":
$result = false;
include dirname(dirname(__FILE__)) . "/pages/pages/friends.php";
break;
case "all":
$result = false;
include dirname(dirname(__FILE__)) . "/pages/pages/world.php";
break;
}
}
return $result;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:34,代码来源:hooks.php
注:本文中的set_input函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论