本文整理汇总了PHP中fetch_sub_branch函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_sub_branch函数的具体用法?PHP fetch_sub_branch怎么用?PHP fetch_sub_branch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_sub_branch函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:30,代码来源:group_object_access_datasource.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:object_versions_datasource.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:33,代码来源:class_group_access_template_datasource.class.php
示例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);
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:change_locale_action.class.php
示例6: _load_answers
function _load_answers($question_path)
{
$params = array(
'depth' => 1
);
return fetch_sub_branch($question_path, 'poll_answer', $params);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:poll_all_results_datasource.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:user_membership_datasource.class.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:objects_access_groups_filter_datasource.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:member_subscribe_params_datasource.class.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:group_object_access_data_source.class.php
示例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();
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:17,代码来源:subscribe_mail.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:18,代码来源:objects_access_groups_list_datasource.class.php
示例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);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:38,代码来源:class_group_action_access_datasource.class.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:5,代码来源:poll_container.class.php
示例16: fetch_sub_branch
function &_fetch(&$counter, $params)
{
$arr =& fetch_sub_branch($params['path'], $params['loader_class_name'], $counter, $params, $params['fetch_method']);
return $arr;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:5,代码来源:fetch_sub_branch_datasource.class.php
注:本文中的fetch_sub_branch函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论