当前位置: 首页>>代码示例>>PHP>>正文


PHP Groups::get_by_name方法代码示例

本文整理汇总了PHP中Groups::get_by_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::get_by_name方法的具体用法?PHP Groups::get_by_name怎么用?PHP Groups::get_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Groups的用法示例。


在下文中一共展示了Groups::get_by_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: is_group_user

 public static function is_group_user($group_name)
 {
     foreach (self::get_groups() as $group) {
         if ($group->get_name() == $group_name) {
             return true;
         }
     }
     $group = Groups::get_by_name($group_name);
     if ($group) {
         return Session::is_user() ? $group->is_user(self::get_user()) : false;
     } else {
         return false;
     }
 }
开发者ID:radiowarwick,项目名称:digiplay,代码行数:14,代码来源:Session.php

示例2: function

                } else {
                    $footer .= "\t\t    \t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t" . $comment->get_comment() . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-footer\"><span class=\"glyphicon glyphicon-time fault-time\" aria-hidden=\"true\"></span>" . $comment->get_postdate() . "<span class=\"glyphicon glyphicon-user fault-user\" aria-hidden=\"true\"></span>" . $comment->get_real_author($comment->get_author()) . "<span class=\"label label-danger\">Developer</span></div>\r\n\t\t\t\t</div>";
                }
            }
        }
        $footer .= "</div>";
    }
    $body = "<p><i>Submitted by: <b>" . $fault->get_real_author($fault->get_author()) . "</b> on: <b>" . $fault->get_postdate() . "</b></i><hr></p>\r\n\t<p>" . $fault->get_content() . "</p>";
    echo Bootstrap::panel($fault->get_panel_class(), $body, $title, $footer);
}
$title = "<span id=\"comment-status-title\">Add a comment to the fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-comment-id\">\r\n    <textarea class=\"form-control fault-comment-value\" rows=\"3\"></textarea>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-primary confirm-fault-comment\">Add Comment</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("add-comment", $body, $title);
$title = "<span id=\"update-status-title\">Change the status of fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-update-id\">\r\n    <select class=\"form-control fault-update-value\" name=\"status\">\r\n\t  <option value=\"1\">Not yet read</option>\r\n\t  <option value=\"2\">On hold</option>\r\n\t  <option value=\"3\">Work in progress</option>\r\n\t  <option value=\"4\">Fault complete</option>\r\n\t</select>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-success confirm-fault-update\">Change Status</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("update-status", $body, $title);
$title = "<span id=\"assign-status-title\">Assign fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-assign-id\">\r\n    <select class=\"form-control fault-assign-value\" name=\"assign\">";
$group = Groups::get_by_name("Developers");
$developers = $group->get_users();
foreach ($developers as $developer) {
    $user = Users::get_by_id($developer->get_id());
    $user_fullname = $user->get_display_name();
    $body .= "<option value=" . $developer->get_id() . ">" . $user_fullname . "</option>";
}
$body .= "</select>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-warning confirm-fault-assign\">Assign Fault</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("assign-fault", $body, $title);
$title = "<span id=\"delete-status-title\">Are you sure you want to delete fault DIGI_</span>";
$body = "<input type=\"hidden\" class=\"fault-delete-id\">\r\n\t\t<a href=\"#\" class=\"btn btn-danger confirm-fault-delete\">Delete</a> \r\n\t\t<a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>";
echo Bootstrap::modal("delete-fault", $body, $title);
echo "<script>\r\n\t\$('.new-comment').click(function() {\r\n\t\t\$('#comment-status-title').html('Add a comment to the fault DIGI_');\r\n\t\t\$('#comment-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-comment-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.change-status').click(function() {\r\n\t\t\$('#update-status-title').html('Change the status of fault DIGI_');\r\n\t\t\$('#update-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-update-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.delete-fault').click(function() {\r\n\t\t\$('#delete-status-title').html('Are you sure you want to delete fault DIGI_');\r\n\t\t\$('#delete-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-delete-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.assign-fault').click(function() {\r\n\t\t\$('#assign-status-title').html('Assign fault DIGI_');\r\n\t\t\$('#assign-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-assign-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.confirm-fault-comment').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/add-update-comment.php',\r\n\t\t\tdata: 'faultid='+\$('.fault-comment-id').val()+'&comment='+\$('.fault-comment-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-update').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=update-status&id='+\$('.fault-update-id').val()+'&status='+\$('.fault-update-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-delete').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=del-fault&id='+\$('.fault-delete-id').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-assign').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=assign-fault&id='+\$('.fault-assign-id').val()+'&assign='+\$('.fault-assign-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n</script>";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:index.php


注:本文中的Groups::get_by_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。