當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Settings::getDefaultGroupIDs方法代碼示例

本文整理匯總了PHP中thebuggenie\core\framework\Settings::getDefaultGroupIDs方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::getDefaultGroupIDs方法的具體用法?PHP Settings::getDefaultGroupIDs怎麽用?PHP Settings::getDefaultGroupIDs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在thebuggenie\core\framework\Settings的用法示例。


在下文中一共展示了Settings::getDefaultGroupIDs方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: javascript_link_tag

                    <?php 
} else {
    ?>
                        <?php 
    echo javascript_link_tag(__('List users in this group'), array('onclick' => 'TBG.Config.Group.showMembers(\'' . make_url('configure_users_get_group_members', array('group_id' => $group->getID())) . '\', ' . $group->getID() . ');'));
    ?>
                    <?php 
}
?>
                </li>
                <li><?php 
echo javascript_link_tag(__('Clone this user group'), array('onclick' => '$(\'clone_group_' . $group->getID() . '\').toggle();'));
?>
</li>
                <?php 
if (!in_array($group->getID(), \thebuggenie\core\framework\Settings::getDefaultGroupIDs()) && !$group->isDefaultUserGroup()) {
    ?>
                    <li><?php 
    echo javascript_link_tag(__('Delete this user group'), array('onclick' => "TBG.Main.Helpers.Dialog.show('" . __('Do you really want to delete this group?') . "', '" . __('If you delete this group, then all users in this group will be disabled until moved to a different group') . "', {yes: {click: function() {TBG.Config.Group.remove('" . make_url('configure_users_delete_group', array('group_id' => $group->getID())) . "', {$group->getID()}); }}, no: { click: TBG.Main.Helpers.Dialog.dismiss }});"));
    ?>
</li>
                <?php 
} else {
    ?>
                    <li class="disabled" title="<?php 
    echo __('The default group cannot be deleted');
    ?>
"><a href="javascript:void(0);"><?php 
    echo __('Delete this user group');
    ?>
</a></li>
開發者ID:founderio,項目名稱:thebuggenie,代碼行數:31,代碼來源:_groupbox.inc.php

示例2: runDeleteGroup

 public function runDeleteGroup(framework\Request $request)
 {
     try {
         if (in_array($request['group_id'], framework\Settings::getDefaultGroupIDs())) {
             throw new \Exception(framework\Context::getI18n()->__("You cannot delete the default groups"));
         }
         try {
             $group = entities\Group::getB2DBTable()->selectById($request['group_id']);
         } catch (\Exception $e) {
         }
         if (!$group instanceof entities\Group) {
             throw new \Exception(framework\Context::getI18n()->__("You cannot delete this group"));
         }
         if ($group->isDefaultUserGroup()) {
             throw new \Exception(framework\Context::getI18n()->__("You cannot delete the group for the default user"));
         }
         $group->delete();
         return $this->renderJSON(array('success' => true, 'message' => framework\Context::getI18n()->__('The group was deleted')));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }
開發者ID:nrensen,項目名稱:thebuggenie,代碼行數:23,代碼來源:Main.php


注:本文中的thebuggenie\core\framework\Settings::getDefaultGroupIDs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。