本文整理汇总了PHP中PermissionPeer::getForSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionPeer::getForSelect方法的具体用法?PHP PermissionPeer::getForSelect怎么用?PHP PermissionPeer::getForSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PermissionPeer
的用法示例。
在下文中一共展示了PermissionPeer::getForSelect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeShow
public function executeShow(sfWebRequest $request)
{
$this->role = RolePeer::retrieveByPk($request->getParameter('id'));
$this->forward404Unless($this->role);
# get all rights
$permissions = PermissionPeer::getForSelect();
# get assigned rights
$rp_list = RolePermissionPeer::getByRoleId($this->role->getId());
$assoc_perms = array();
foreach ($rp_list as $rp) {
$assoc_perms[] = $rp->getPermissionId();
}
$this->assoc_perms = $assoc_perms;
# prepare widget
$this->widget = new sfWidgetFormSelectDoubleList(array('choices' => $permissions, 'label_unassociated' => 'Full List', 'label_associated' => 'Rights Assigned to Role', 'class' => 'security', 'associate' => 'lt;', 'unassociate' => 'gt;', 'unassociate_class' => 'btn-left', 'template' => <<<EOF
<div class="%class%" style="padding-top: 0px;">
<div class="holder">
<h4>%label_unassociated%</h4>
%unassociated%
</div>
<ul class="btn-switch">
<li>%associate%</li>
<li>%unassociate%</li>
</ul>
<div class="holder">
<h4>%label_associated%</h4>
%associated%
</div>
<br style="clear: both" />
<script type="text/javascript">
sfDoubleList.init(document.getElementById('%id%'), '%class_select%');
</script>
</div>
EOF
));
}