本文整理汇总了PHP中Base_AclCommon::display_clearances方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_AclCommon::display_clearances方法的具体用法?PHP Base_AclCommon::display_clearances怎么用?PHP Base_AclCommon::display_clearances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_AclCommon
的用法示例。
在下文中一共展示了Base_AclCommon::display_clearances方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
public function admin()
{
if ($this->is_back()) {
$this->parent->reset();
}
Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
Base_ActionBarCommon::add('add', __('Add Home Page'), $this->create_callback_href(array($this, 'edit_home_page')));
$gb = $this->init_module(Utils_GenericBrowser::module_name(), null, 'home_page_admin');
$gb->set_table_columns(array(array('name' => 'Home Page'), array('name' => 'Clearance')));
$pages = DB::Execute('SELECT * FROM base_home_page ORDER BY priority');
$next = null;
while ($row = $pages->FetchRow()) {
$gbr = $gb->get_new_row();
$clearances = DB::GetAssoc('SELECT id, clearance FROM base_home_page_clearance WHERE home_page_id=%d', array($row['id']));
$gbr->add_data($row['home_page'], Base_AclCommon::display_clearances($clearances));
if ($next) {
$next->add_action($this->create_callback_href(array($this, 'change_priority'), array($last_row['id'], $last_row['priority'], +1)), 'Move down', null, 'move-down');
}
if ($row['priority'] > 1) {
$gbr->add_action($this->create_callback_href(array($this, 'change_priority'), array($row['id'], $row['priority'], -1)), 'Move up', null, 'move-up');
}
$gbr->add_action($this->create_callback_href(array($this, 'delete_home_page'), array($row['id'])), 'Delete');
$gbr->add_action($this->create_callback_href(array($this, 'edit_home_page'), array($row['id'])), 'Edit');
$next = $gbr;
$last_row = $row;
}
$this->display_module($gb);
eval_js('base_home_page__initialized = false;');
}
示例2: edit_permissions
public function edit_permissions($permission_name = null)
{
if ($this->is_back()) {
Base_BoxCommon::pop_main();
}
Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
Base_ThemeCommon::load_css('Base_Acl', 'edit_permissions');
$gb = $this->init_module('Utils_GenericBrowser', 'acl_editor', 'acl_editor');
$gb->set_table_columns(array(array('name' => ' ', 'width' => 20)));
$sql = 'SELECT id, name FROM base_acl_permission';
$args = array();
$perm_id = null;
if ($permission_name) {
$sql .= ' WHERE name=%s';
$args[] = $permission_name;
$perm_id = DB::GetOne('SELECT id FROM base_acl_permission WHERE name=%s', array($permission_name));
}
$sql .= ' ORDER BY name ASC';
$perms = DB::GetAssoc($sql, $args);
Base_ActionBarCommon::add('add', __('Add rule'), $this->create_callback_href(array($this, 'edit_rule'), array(null, $perm_id)));
foreach ($perms as $p_id => $p_name) {
$gb_row = $gb->get_new_row();
$gb_row->add_data(array('value' => _V($p_name), 'class' => 'Base_Acl__permission', 'attrs' => 'colspan="2"'));
$gb_row->no_actions();
$perms = DB::GetAssoc('SELECT id, id FROM base_acl_rules WHERE permission_id=%d', array($p_id));
foreach ($perms as $r_id) {
$clearances = DB::GetAssoc('SELECT id, clearance FROM base_acl_rules_clearance WHERE rule_id=%d', array($r_id));
$gb_row = $gb->get_new_row();
$gb_row->add_action($this->create_confirm_callback_href(__('Are you sure you want to delete this rule?'), array($this, 'delete_rule'), array($r_id)), 'delete', __('Delete Rule'));
$gb_row->add_action($this->create_callback_href(array($this, 'edit_rule'), array($r_id, $p_id)), 'edit', __('Edit Rule'));
$gb_row->add_data(Base_AclCommon::display_clearances($clearances));
}
}
$this->display_module($gb);
eval_js('base_acl__initialized = false;');
}