本文整理汇总了PHP中fetch_requested_object函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_requested_object函数的具体用法?PHP fetch_requested_object怎么用?PHP fetch_requested_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_requested_object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
function run(&$filter_chain, &$request, &$response)
{
debug::add_timing_point('authentication filter started');
if (!($object_data = fetch_requested_object($request))) {
if (!($node = map_request_to_node($request))) {
if (defined('ERROR_DOCUMENT_404')) {
$response->redirect(ERROR_DOCUMENT_404);
} else {
$response->header("HTTP/1.1 404 Not found");
}
return;
}
$response->redirect('/root/login?redirect=' . urlencode($_SERVER['REQUEST_URI']));
return;
}
$object =& wrap_with_site_object($object_data);
$site_object_controller =& $object->get_controller();
if (($action = $site_object_controller->determine_action($request)) === false) {
debug::write_error('"' . $action . '" action not found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
if (defined('ERROR_DOCUMENT_404')) {
$response->redirect(ERROR_DOCUMENT_404);
} else {
$response->header("HTTP/1.1 404 Not found");
}
debug::add_timing_point('authentication filter finished');
$filter_chain->next();
return;
}
$actions = $object->get_attribute('actions');
if (!isset($actions[$action])) {
$response->redirect('/root/login?redirect=' . urlencode($_SERVER['REQUEST_URI']));
}
debug::add_timing_point('authentication filter finished');
$filter_chain->next();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:35,代码来源:authentication_filter.class.php
示例2: perform
function perform(&$request, &$response)
{
$request->set_status(REQUEST_STATUS_SUCCESS);
if ($request->has_attribute('popup')) {
$response->write(close_popup_response($request));
}
if (!($object = wrap_with_site_object(fetch_requested_object()))) {
return;
}
$site_object_controller =& $object->get_controller();
$action = $site_object_controller->determine_action($request);
switch ($action) {
case 'publish':
$status = $this->get_publish_status($object);
break;
case 'unpublish':
$status = $this->get_unpublish_status($object);
break;
default:
return;
break;
}
$object->set_attribute('status', $status);
$object->update(false);
$this->_apply_access_policy($object, $action);
flush_fetcher_cache();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:set_publish_status_action.class.php
示例3: _init_dataspace
function _init_dataspace(&$request)
{
parent::_init_dataspace($request);
$parent_object_data =& fetch_requested_object($request);
$data['subscribe_mail_content'] = $parent_object_data['mail_template'];
$this->dataspace->import($data);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:create_subscribe_mail_action.class.php
示例4: _send_mail
function _send_mail()
{
$title = $this->get_attribute('title');
$content = $this->get_attribute('content');
$author = $this->get_attribute('author');
$subscribe_email = ADMINISTRATOR_EMAIL; //fix
$parent_object_data =& fetch_requested_object();
$recipients = $this->_get_theme_subscribers($parent_object_data['id']);
if(!count($recipients))
return false;
foreach($recipients as $recipient)
{
@ send_html_mail(
array('"' . $recipient['name'].'" <'. $recipient['email'] .'>'),
'"' . $author.'" <'. $subscribe_email .'>', $title,
$content);
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:subscribe_mail.class.php
示例5: _is_home_hit
function _is_home_hit()
{
if(!$object_data = fetch_requested_object())
return false;
return ($object_data['parent_node_id'] == 0);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:stats_counter.class.php
示例6: array
function &get_dataset(&$counter, $params = array())
{
$object_data = fetch_requested_object();
if (!count($object_data)) {
return new array_dataset(array());
}
$db_table =& db_table_factory::instance('sys_object_version');
$arr = $db_table->get_list('object_id=' . $object_data['id'], 'version DESC');
$result = array();
$users =& fetch_sub_branch('/root/users', 'user_object', $counter);
foreach ($arr as $data) {
$record = $data;
$user = '';
if (count($users)) {
foreach ($users as $user_data) {
if ($user_data['id'] == $data['creator_id']) {
$user = $user_data;
break;
}
}
}
if ($user) {
$record['creator_identifier'] = $user['identifier'];
$record['creator_email'] = $user['email'];
$record['creator_name'] = $user['name'];
$record['creator_lastname'] = isset($user['lastname']) ? $user['lastname'] : '';
}
$result[] = $record;
}
return new array_dataset($result);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:object_versions_datasource.class.php
示例7: save
function save()
{
$request =& request::instance();
$tab_id = session_history_manager::datermine_tab_id();
if (!($history = session::get('session_history'))) {
$history = array();
}
if (!isset($history[$tab_id])) {
$history[$tab_id] = array();
}
$uri =& $request->get_uri();
$uri->remove_query_item('rn');
if ($uri->get_query_item('popup')) {
return;
}
$object_data = fetch_requested_object();
if ($object_data['class_name'] == 'control_panel') {
return;
}
$history_item = array('title' => $object_data['title'], 'href' => $uri->to_string());
$first = end($history[$tab_id]);
if ($first) {
$latest_uri =& new uri($first['href']);
if ($uri->compare($latest_uri)) {
return;
}
}
if (count($history[$tab_id]) >= 10) {
$history[$tab_id] = array_reverse($history[$tab_id]);
array_pop($history[$tab_id]);
$history[$tab_id] = array_reverse($history[$tab_id]);
}
array_push($history[$tab_id], $history_item);
session::set('session_history', $history);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:35,代码来源:session_history_manager.class.php
示例8: get_dataset
function & get_dataset($params = array())
{
if(!$arr = fetch_requested_object())
return new array_dataset();
$db_table =& db_table_factory :: instance('sys_class');
$classes = $db_table->get_list('', 'class_name');
$result = array();
$params = array();
foreach($classes as $class_id => $class_data)
{
$result[$class_id] = $class_data;
$result[$class_id]['path'] = $arr['path'];
$params['class_id'] = $class_id;
$result[$class_id]['node_id'] = $arr['node_id'];
foreach($arr['actions'] as $action_name => $action_params)
$arr['actions'][$action_name]['extra'] = $params;
$result[$class_id]['actions'] = $arr['actions'];
}
return new array_dataset($result);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:class_list_datasource.class.php
示例9: _is_home_hit
function _is_home_hit()
{
if (!($object_data = fetch_requested_object())) {
return false;
}
return $object_data['parent_node_id'] == 0;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:stats_counter.class.php
示例10: perform
function perform(&$request, &$response)
{
$request->set_status(REQUEST_STATUS_DONT_TRACK);
$object =& fetch_requested_object();
session :: set('limb_image_select_working_path', $object['path']);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:image_select_action.class.php
示例11: get_path
function get_path()
{
if (!$this->path) {
$object_arr =& fetch_requested_object();
$this->path = $object_arr['path'];
}
return $this->path;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:fetch_component.class.php
示例12: _valid_perform
function _valid_perform(&$request, &$response)
{
$object_data =& fetch_requested_object($request);
$data = $this->dataspace->export();
$object =& site_object_factory::create('user_object');
$object->save_membership($object_data['id'], $data['membership']);
$request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:set_membership.class.php
示例13: perform
function perform(&$request, &$response)
{
$object_data =& fetch_requested_object($request);
$ini =& get_ini('image_variations.ini');
$image_variations = $ini->get_all();
foreach ($image_variations as $key => $value) {
if (array_key_exists($key, $_GET)) {
$variation = $key;
break;
}
}
if (empty($variation)) {
$variation = 'thumbnail';
}
$image = $object_data['variations'][$variation];
if (!$image) {
$response->header("Content-type: image/gif");
$response->readfile(SHARED_DIR . 'images/1x1.gif');
if ($variation == 'original') {
$request->set_status(REQUEST_STATUS_FAILURE);
return;
} else {
$response->commit();
//for speed
}
}
if (!file_exists(MEDIA_DIR . $image['media_id'] . '.media')) {
$response->header("HTTP/1.1 404 Not found");
if ($variation == 'original') {
$request->set_status(REQUEST_STATUS_FAILURE);
return;
} else {
$response->commit();
//for speed
}
}
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $image['etag']) {
$response->use_client_cache();
$response->header("Pragma: public");
$response->header("Cache-Control: private");
$response->header("Date: " . date("D, d M Y H:i:s") . " GMT");
$response->header("Etag: {$image['etag']}");
} else {
$response->header("Pragma: public");
$response->header("Cache-Control: private");
$response->header("Date: " . date("D, d M Y H:i:s") . " GMT");
$response->header("Etag: {$image['etag']}");
$response->header("Content-type: {$image['mime_type']}");
$response->header("Content-Disposition: filename={$image['file_name']}");
$response->readfile(MEDIA_DIR . $image['media_id'] . '.media');
}
if ($variation == 'original') {
return;
} else {
$response->commit();
//for speed
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:58,代码来源:display_image_action.class.php
示例14: array
function &get_dataset($params = array())
{
if (!fetch_requested_object()) {
return new array_dataset();
}
$db_table =& db_table_factory::instance('sys_controller');
$controllers = $db_table->get_list('', 'name');
return new array_dataset($controllers);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:controller_list_datasource.class.php
示例15: run
function run(&$filter_chain, &$request, &$response)
{
debug :: add_timing_point('authentication filter started');
if(!$object_data = fetch_requested_object($request))
{
if(!$node = map_request_to_node($request))
{
if(defined('ERROR_DOCUMENT_404'))
$response->redirect(ERROR_DOCUMENT_404);
else
$response->header("HTTP/1.1 404 Not found");
return;
}
$response->redirect('/root/login?redirect='. urlencode($request->to_string()));
return;
}
$object =& wrap_with_site_object($object_data);
$site_object_controller =& $object->get_controller();
if(($action = $site_object_controller->determine_action($request)) === false)
{
debug :: write_error('"'. $action . '" action not found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
if(defined('ERROR_DOCUMENT_404'))
$response->redirect(ERROR_DOCUMENT_404);
else
$response->header("HTTP/1.1 404 Not found");
debug :: add_timing_point('authentication filter finished');
$filter_chain->next();
return;
}
$actions = $object->get_attribute('actions');
if(!isset($actions[$action]))
{
$redirect_path = $site_object_controller->get_action_property($action, 'inaccessible_redirect');
if(!$redirect_path)
$redirect_path = '/root/login';
$redirect_strategy =& $this->_get_redirect_strategy($site_object_controller, $action);
$response->set_redirect_strategy($redirect_strategy);
$response->redirect($redirect_path . '?redirect='. urlencode($request->to_string()));
}
debug :: add_timing_point('authentication filter finished');
$filter_chain->next();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:57,代码来源:authentication_filter.class.php
示例16: _fetch_object_data
function & _fetch_object_data()
{
$request =& request :: instance();
if($object_id = $request->get_attribute('object_id'))
return fetch_one_by_id($object_id);
else
return fetch_requested_object();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:object_detail_info_datasource.class.php
示例17: run
function run(&$filter_chain, &$request, &$response)
{
$filter_chain->next();
debug::add_timing_point('logging filter started');
$object = wrap_with_site_object(fetch_requested_object($request));
$controller = $object->get_controller();
include_once LIMB_DIR . 'core/model/stats/stats_register.class.php';
$stats_register = new stats_register();
$stats_register->register($object->get_node_id(), $controller->get_action(), $request->get_status());
debug::add_timing_point('logging filter finished');
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:logging_filter.class.php
示例18: _update_object_operation
function _update_object_operation()
{
if ($file = $this->dataspace->get('file')) {
$object_data =& fetch_requested_object();
$this->object->set_attribute('media_id', $object_data['media_id']);
$this->object->set_attribute('tmp_file_path', $file['tmp_name']);
$this->object->set_attribute('file_name', $file['name']);
$this->object->set_attribute('mime_type', $file['type']);
}
return parent::_update_object_operation();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:edit_file_action.class.php
示例19: _init_validator
function _init_validator()
{
parent::_init_validator();
if ($object_data =& fetch_requested_object()) {
$this->validator->add_rule($v1 = array(LIMB_DIR . '/core/lib/validators/rules/unique_user_rule', 'identifier', $object_data['identifier']));
$this->validator->add_rule($v2 = array(LIMB_DIR . '/core/lib/validators/rules/unique_user_email_rule', 'email', $object_data['email']));
}
$this->validator->add_rule($v3 = array(LIMB_DIR . '/core/lib/validators/rules/required_rule', 'name'));
$this->validator->add_rule($v4 = array(LIMB_DIR . '/core/lib/validators/rules/required_rule', 'email'));
$this->validator->add_rule($v5 = array(LIMB_DIR . '/core/lib/validators/rules/email_rule', 'email'));
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:edit_user_action.class.php
示例20: run
function run(&$filter_chain, &$request, &$response)
{
debug::add_timing_point('site object controller filter started');
$site_object =& wrap_with_site_object(fetch_requested_object($request));
$site_object_controller =& $site_object->get_controller();
$site_object_controller->process($request, $response);
if ($response->is_empty()) {
$site_object_controller->display_view();
}
debug::add_timing_point('site object controller filter finished');
$filter_chain->next();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:site_object_controller_filter.class.php
注:本文中的fetch_requested_object函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论