本文整理匯總了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
));
}