本文整理汇总了PHP中fetch_sub_branch函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_sub_branch函数的具体用法?PHP fetch_sub_branch怎么用?PHP fetch_sub_branch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_sub_branch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function &get_dataset($params = array())
{
$request = request::instance();
if (!($controller_id = $request->get_attribute('controller_id'))) {
return new array_dataset();
}
$db_table =& db_table_factory::instance('sys_controller');
$controller_data = $db_table->get_row_by_id($controller_id);
if (!$controller_data) {
return new array_dataset();
}
$site_object_controller =& site_object_controller::create($controller_data['name']);
$actions = $site_object_controller->get_actions_definitions();
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
$result = array();
foreach ($actions as $action => $action_params) {
if (isset($action_params['action_name'])) {
$result[$action]['action_name'] = $action_params['action_name'];
} else {
$result[$action]['action_name'] = str_replace('_', ' ', strtoupper($action[0]) . substr($action, 1));
}
$result[$action]['permissions_required'] = $action_params['permissions_required'];
foreach ($user_groups as $group_id => $group_data) {
$result[$action]['groups'][$group_id]['selector_name'] = 'policy[' . $group_id . '][' . $action . ']';
}
}
return new array_dataset($result);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:28,代码来源:controller_group_action_access_datasource.class.php
示例2: _fetch
function & _fetch(&$counter, $params)
{
$tree_array = parent :: _fetch($counter, $params);
$group_params['order'] = array('priority' => 'ASC');
$user_groups =& fetch_sub_branch('/root/admin/user_groups', 'user_group', $counter, $group_params);
$dataspace =& dataspace_registry :: get('set_group_access');
$groups = $dataspace->get('filter_groups');
if (!is_array($groups) || !count($groups))
return $tree_array;
foreach(array_keys($user_groups) as $key)
{
if (!in_array($key, $groups))
unset($user_groups[$key]);
}
foreach($tree_array as $id => $node)
{
$object_id = $node['id'];
foreach($user_groups as $group_id => $group_data)
{
$tree_array[$id]['groups'][$group_id]['selector_name'] = 'policy[' . $object_id . '][' . $group_id . ']';
}
}
return $tree_array;
}
示例3: array
function &get_dataset(&$counter, $params = array())
{
$object_data = fetch_mapped_by_url();
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);
}
示例4: array
function &get_dataset($params = array())
{
$request = request::instance();
if (!($class_id = $request->get_attribute('class_id'))) {
return new array_dataset();
}
$db_table =& db_table_factory::instance('sys_class');
$class_data = $db_table->get_row_by_id($class_id);
if (!$class_data) {
return new array_dataset();
}
$c =& site_object_factory::instance($class_data['class_name']);
$site_object_controller =& $c->get_controller();
$actions = $site_object_controller->get_actions_definitions();
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
$result = array();
foreach ($user_groups as $group_id => $group_data) {
foreach ($actions as $action => $action_params) {
if (!isset($action_params['can_have_access_template']) || !$action_params['can_have_access_template']) {
continue;
}
if (isset($action_params['action_name'])) {
$result[$group_id]['actions'][$action]['action_name'] = $action_params['action_name'];
} else {
$result[$group_id]['actions'][$action]['action_name'] = str_replace('_', ' ', strtoupper($action[0]) . substr($action, 1));
}
$result[$group_id]['group_name'] = $group_data['identifier'];
$result[$group_id]['actions'][$action]['read_selector_name'] = 'template[' . $action . '][' . $group_id . '][r]';
$result[$group_id]['actions'][$action]['write_selector_name'] = 'template[' . $action . '][' . $group_id . '][w]';
}
}
return new array_dataset($result);
}
示例5: _valid_perform
function _valid_perform(&$request, &$response)
{
$locale_id = $this->dataspace->get('locale_id');
$object_data = $this->_load_object_data();
$site_object =& wrap_with_site_object($object_data);
$site_object->set_locale_id($locale_id);
$site_object->update(false);
$request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
if($request->has_attribute('popup'))
$response->write(close_popup_response($request));
if(!$this->dataspace->get('locale_recursive'))
return;
$params = array('depth' => -1,
'restrict_by_class' => false
);
$objects = fetch_sub_branch($object_data['path'], 'site_object', $counter, $params);
foreach ($objects as $object_id => $object_data)
{
$site_object =& wrap_with_site_object($object_data);
$site_object->set_locale_id($locale_id);
$site_object->update(false);
}
}
示例6: _load_answers
function _load_answers($question_path)
{
$params = array(
'depth' => 1
);
return fetch_sub_branch($question_path, 'poll_answer', $params);
}
示例7: array
function &get_dataset(&$counter, $params = array())
{
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter, $params);
foreach ($user_groups as $id => $group_data) {
$result[$group_data['id']] = $group_data;
$result[$group_data['id']]['selector_name'] = 'membership[' . $group_data['id'] . ']';
}
return new array_dataset($result);
}
示例8: get_options_array
function get_options_array()
{
$params['order'] = array('priority' => 'ASC');
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter, $params);
$options_array = array();
foreach ($user_groups as $key => $user) {
$options_array[$key] = $user['title'];
}
return $options_array;
}
示例9: array
function &get_dataset(&$counter, $params = array())
{
$themes =& fetch_sub_branch('/root/subscribe', 'subscribe_theme', $counter, $params);
if (!count($themes)) {
return new array_dataset(array());
}
foreach ($themes as $id => $theme_data) {
$result[$theme_data['id']] = $theme_data;
$result[$theme_data['id']]['selector_name'] = 'subscribe[' . $theme_data['id'] . ']';
}
return new array_dataset($result);
}
示例10: fetch_sub_branch
function &_fetch(&$counter, $params)
{
$tree_array = parent::_fetch($counter, $params);
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
foreach ($tree_array as $id => $node) {
$object_id = $node['id'];
foreach ($user_groups as $group_id => $group_data) {
$tree_array[$id]['groups'][$group_id]['read_selector_name'] = 'policy[' . $object_id . '][' . $group_id . '][r]';
$tree_array[$id]['groups'][$group_id]['write_selector_name'] = 'policy[' . $object_id . '][' . $group_id . '][w]';
}
}
return $tree_array;
}
示例11: _get_subscribers_from_branch
function _get_subscribers_from_branch($path)
{
$params = array('restrict_by_class' => false);
$temp_list =& fetch_sub_branch($path, 'site_object', $counter, $params);
if (count($temp_list)) {
$record = reset($temp_list);
$subscribers_class_name = $record['class_name'];
} else {
return array();
}
$subscribers_list =& fetch_sub_branch($path, $subscribers_class_name, $counter);
if (is_array($subscribers_list) && count($subscribers_list)) {
return $subscribers_list;
} else {
return array();
}
}
示例12: array
function &get_dataset(&$counter, $params = array())
{
$params['order'] = array('priority' => 'ASC');
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter, $params);
$group_params['order'] = array('priority' => 'ASC');
$groups =& fetch('user_group', $counter, $group_params, 'fetch');
$dataspace =& dataspace_registry::get('set_group_access');
$filter_groups = $dataspace->get('filter_groups');
if (!is_array($filter_groups) || !count($filter_groups)) {
return false;
}
foreach (array_keys($groups) as $key) {
if (!in_array($key, $filter_groups)) {
unset($groups[$key]);
}
}
return new array_dataset($groups);
}
示例13: get_dataset
function & get_dataset($params = array())
{
if(!isset($_REQUEST['class_id']))
return new array_dataset();
$class_id = $_REQUEST['class_id'];
$db_table =& db_table_factory :: instance('sys_class');
$class_data = $db_table->get_row_by_id($class_id);
if (!$class_data)
return new array_dataset();
$c =& site_object_factory :: instance($class_data['class_name']);
$site_object_controller =& $c->get_controller();
$actions = $site_object_controller->get_actions_definitions();
$user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
$result = array();
foreach($actions as $action => $action_params)
{
if(isset($action_params['action_name']))
$result[$action]['action_name'] = $action_params['action_name'];
else
$result[$action]['action_name'] = str_replace('_', ' ', strtoupper($action{0}) . substr($action, 1));
$result[$action]['permissions_required'] = $action_params['permissions_required'];
foreach($user_groups as $group_id => $group_data)
{
$result[$action]['groups'][$group_id]['selector_name'] = 'policy[' . $group_id . '][' . $action . ']';
}
}
return new array_dataset($result);
}
示例14: get_dataset
function & get_dataset($params = array())
{
if(!$controller_id = $this->_get_controller_id())
return new array_dataset();
$db_table =& db_table_factory :: instance('sys_controller');
$controller_data = $db_table->get_row_by_id($controller_id);
if (!$controller_data)
return new array_dataset();
$site_object_controller =& site_object_controller :: create($controller_data['name']);
$actions = $site_object_controller->get_actions_definitions();
$user_groups =& fetch_sub_branch('/root/admin/user_groups', 'user_group', $counter);
$result = array();
foreach($user_groups as $group_id => $group_data)
{
foreach($actions as $action => $action_params)
{
if (!isset($action_params['can_have_access_template']) || !$action_params['can_have_access_template'])
continue;
if(isset($action_params['action_name']))
$result[$group_id]['actions'][$action]['action_name'] = $action_params['action_name'];
else
$result[$group_id]['actions'][$action]['action_name'] = str_replace('_', ' ', strtoupper($action{0}) . substr($action, 1));
$result[$group_id]['group_name'] = $group_data['identifier'];
$result[$group_id]['actions'][$action]['selector_name'] = 'template[' . $action . '][' . $group_id . ']';
}
}
return new array_dataset($result);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:38,代码来源:controller_group_access_template_datasource.class.php
示例15: fetch_sub_branch
function &_load_answers($question_path)
{
$result =& fetch_sub_branch($question_path, 'poll_answer', $counter);
return $result;
}