本文整理汇总了PHP中fetch_requested_object函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_requested_object函数的具体用法?PHP fetch_requested_object怎么用?PHP fetch_requested_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_requested_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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);
}
示例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;
}
示例5: _is_home_hit
function _is_home_hit()
{
if(!$object_data = fetch_requested_object())
return false;
return ($object_data['parent_node_id'] == 0);
}
示例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);
}
示例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);
}
示例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);
}
示例9: _is_home_hit
function _is_home_hit()
{
if (!($object_data = fetch_requested_object())) {
return false;
}
return $object_data['parent_node_id'] == 0;
}
示例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']);
}
示例11: get_path
function get_path()
{
if (!$this->path) {
$object_arr =& fetch_requested_object();
$this->path = $object_arr['path'];
}
return $this->path;
}
示例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);
}
示例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
}
}
示例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);
}
示例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();
}