本文整理汇总了PHP中Role::getRole方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::getRole方法的具体用法?PHP Role::getRole怎么用?PHP Role::getRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::getRole方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertRole
function insertRole($data)
{
$connection = connect();
$role = new Role();
echo dump($data);
$role->setRole(mysqli_real_escape_string($connection, $data['role']));
$role->setDescription(mysqli_real_escape_string($connection, $data['description']));
$query = "insert into role (";
$query .= " role,description ";
$query .= ") values( ";
$query .= " '{$role->getRole()}','{$role->getDescription()}'";
$query .= ")";
$result = mysqli_query($connection, $query);
if ($result) {
$id = mysqli_insert_id($connection);
return $id;
}
colse_connection($connection);
return null;
}
示例2: foreach
</li>
<?php
}
?>
<li class="list-group-item text-center"><button type="button" class="btn btn-danger delete_account" id="<?php
echo $item->id;
?>
">Delete Account</button></li>
</ul>
</div>
<div class="col-sm-6">
<div class="row">
<h4>Roles</h4>
<?php
foreach ($item->roles as $role_name => $perm) {
$role = Role::getRole($db, $role_name);
?>
<div class="form-group">
<label class="col-sm-8 control-label" for="<?php
echo $item->id;
?>
_<?php
echo $role['role_id'];
?>
"><?php
echo $role['role_name'];
?>
</label>
<div class="col-sm-4">
<button type="button" class="btn btn-danger btn-sm remove_user_role" id="<?php
echo $item->id;
示例3: get_message
?>
</h1>
</div>
<?php
get_message();
?>
<?php
if (is_single()) {
?>
<?php
$role_id = get_var('id');
$role = $role_id ? Role::getRole($role_id) : false;
$role_name = $role ? $role->getName() : '';
?>
<?php
if (get_var('action') != 'add' && !$role) {
?>
<?php
create_message('danger', 'Role does not exist!', true);
?>
<?php
} else {
?>
示例4: getAllReleases
public static function getAllReleases()
{
if (Release::$allReleases === null) {
Release::$allReleases = array();
$xvid = Codec::getCodec("xvid");
$mp3 = Codec::getCodec("mp3");
$avi = Codec::getCodec("avi");
$h264 = Codec::getCodec("h264");
$aac = Codec::getCodec("aac");
$ac3 = Codec::getCodec("ac3");
$mp4 = Codec::getCodec("mp4");
$mkv = Codec::getCodec("mkv");
$dvd = ReleaseSource::getSource("DVD");
$bd = ReleaseSource::getSource("BD");
$release = new Release(Project::getProject("mitsudomoe"), "ep0");
$release->setName("preview");
$release->setPreviewUrl("images/episodes/mitsudomoepreview.jpg");
$release->setSynopsis("Bande-Annonce de la série Mitsudomoe qui débutera en juillet 2010.");
$release->setOriginalTitle("Trailer");
$release->setLocalizedTitle("Bande-Annonce");
$release->addStaff(TeamMember::getMemberByPseudo("Sazaju HITOKAGE"), Role::getRole('tradJp'));
$release->addStaff(TeamMember::getMemberByPseudo("db0"), Role::getRole('adapt'));
$release->addStaff(TeamMember::getMemberByPseudo("db0"), Role::getRole('time'));
$release->addStaff(TeamMember::getMemberByPseudo("db0"), Role::getRole('edit'));
$release->addStaff(TeamMember::getMemberByPseudo("praia"), Role::getRole('qc'));
$release->addStaff(TeamMember::getMemberByPseudo("lepims"), Role::getRole('encod'));
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_Preview[Xvid-MP3][5ED85545].avi");
$descriptor->setVideoCodec($xvid);
$descriptor->setSoundCodec($mp3);
$descriptor->setContainerCodec($avi);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep1");
$release->setName("épisode 01");
$release->setPreviewUrl("images/episodes/mitsudomoe1.jpg");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_01[BD][H264-AAC][A551786E].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep2");
$release->setName("épisode 02");
$release->setPreviewUrl("images/episodes/mitsudomoe2.jpg");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_02[BD][H264-AAC][D324A25E].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep3");
$release->setName("épisode 03");
$release->setPreviewUrl("images/episodes/mitsudomoe3.jpg");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_03[BD][H264-AAC][8C7C6BC3].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep4");
$release->setName("épisode 04");
$release->setPreviewUrl("images/episodes/mitsudomoe4.jpg");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_04[BD][H264-AAC][A9514039].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep5");
$release->setName("épisode 05");
$release->setPreviewUrl("images/episodes/mitsudomoe5.jpg");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_05[BD][H264-AAC][199319E2].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(0);
Release::$allReleases[] = $release;
$release = new Release(Project::getProject("mitsudomoe"), "ep6");
$release->setName("épisode 06");
$release->setPreviewUrl("images/episodes/mitsudomoe6.jpg");
$release->setHeaderImage("images/sorties/mitsudomoe6.png");
$descriptor = new ReleaseFileDescriptor("[Zero]Mitsudomoe[BD][H264-AAC]/[Zero]Mitsudomoe_06[BD][H264-AAC][43B2986A].mp4");
$descriptor->setReleaseSource($bd);
$descriptor->setVideoCodec($h264);
$descriptor->setSoundCodec($aac);
$descriptor->setContainerCodec($mp4);
$release->addFileDescriptor($descriptor);
$release->setReleasingTime(strtotime("10 October 2011"));
Release::$allReleases[] = $release;
//.........这里部分代码省略.........
示例5: getAllMembers
public static function getAllMembers()
{
if (TeamMember::$allMembers === null) {
TeamMember::$allMembers = array();
$member = new TeamMember();
$member->setPseudo("db0");
$member->setIsAdmin(true);
$member->addRole(Role::getRole("fondatrice"));
$member->addRole(Role::getRole("forumadmin"));
$member->setImage("db0.png");
$member->setAge(19);
$member->setLocation("Le Kremlin-Bicetre (94)");
$member->setMail("db0company@gmail.com");
$member->setWebsite("http://db0.fr/", "db0.fr");
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Jembé");
$member->setImage("jembe.png");
$member->addRole(Role::getRole("adapt"));
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Ryuuken");
$member->setImage("ryuuken.jpeg");
$member->addRole(Role::getRole("adapt"));
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Nyaan~");
$member->setImage("nyaan.png");
$member->addRole(Role::getRole("time"));
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Sazaju HITOKAGE");
$member->addRole(Role::getRole("tradJp"));
$member->addRole(Role::getRole("adapt"));
$member->addRole(Role::getRole("torrent"));
$member->addRole(Role::getRole("xdcc"));
$member->addRole(Role::getRole("webadmin"));
$member->setIsAdmin(true);
$member->setImage("sazaju.png");
$member->setMail("sazaju@gmail.com");
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("lepims");
$member->addRole(Role::getRole("encod"));
$member->setFirstName("Lepims");
$member->setAge(25);
$member->setImage("lepims.gif");
$member->setLocation("Clermont-Ferrand");
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("DC");
$member->setImage("dc.jpg");
$member->addRole(Role::getRole("encod"));
$member->setFirstName("Denis");
//$member->setAge(24);
$member->setLocation("Lyon");
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("praia");
$member->setImage("praia.jpg");
$member->addRole(Role::getRole("ortho"));
$member->addRole(Role::getRole("qc"));
$member->addRole(Role::getRole("forumadmin"));
$member->setIsAdmin(true);
//$member->setFirstName("Piet");
//$member->setAge(30);
$member->setLocation("Belgique");
//$member->setMail("raiapietro_dam22@hotmail.com");
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Personne");
$member->setImage("personne.jpg");
$member->addRole(Role::getRole("edit"));
$member->addRole(Role::getRole("kara"));
$member->setAge(23);
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Nyaa-Gentle");
$member->setImage("nyaa-gentle.jpeg");
$member->addRole(Role::getRole("time"));
$member->setAvailability(TeamMember::AVAILABLE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("ZackDeMars");
$member->setImage("zack.jpg");
$member->addRole(Role::getRole("tradEn"));
$member->setFirstName("Zack");
$member->setAge(22);
$member->setLocation("Marseille");
$member->setAvailability(TeamMember::GONE);
TeamMember::$allMembers[] = $member;
$member = new TeamMember();
$member->setPseudo("Shana-chan");
$member->setImage("shana.png");
$member->addRole(Role::getRole("tradEn"));
//.........这里部分代码省略.........