コード例 #1
0
 public function __construct()
 {
     $title = $body = $button = NULL;
     switch (pageArray(1)) {
         case "all":
         default:
             if (loggedIn()) {
                 $admin_groups = Setting::get("admin_groups");
                 if (!$admin_groups) {
                     $admin_groups = "users";
                 }
                 if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
                     $button = "<a href='" . getSiteURL() . "groups/create' class='btn btn-success'>Create a Group</a>";
                 }
             }
             $title = "Groups";
             $body = display("pages/groups");
             break;
         case "create":
             $admin_groups = Setting::get("admin_groups");
             if (!$admin_groups) {
                 $admin_groups = "user";
             }
             if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
                 $title = "Create a Group";
                 $body = drawForm(array("name" => "create_group", "action" => "createGroup", "method" => "post", "files" => true));
             }
             break;
         case "view":
             $guid = pageArray(2);
             $group = getEntity($guid);
             $edit_url = getSiteURL() . "groups/edit/{$guid}";
             $delete_url = addTokenToURL(getSiteURL() . "action/deleteGroup/{$guid}");
             if ($group->ownerIsLoggedIn()) {
                 $button = "<a href='{$edit_url}' class='btn btn-warning'>Edit Group</a>";
                 $button .= "<a href='{$delete_url}' class='btn btn-danger confirm'>Delete Group</a>";
             }
             if (GroupsPlugin::loggedInUserCanJoin($group)) {
                 $join_group_url = addTokenToURL(getSiteURL() . "action/JoinGroup/" . $group->guid);
                 $button .= "<a href='{$join_group_url}' class='btn btn-success confirm'>Join Group</a>";
             }
             if ($group->loggedInUserIsMember() && $group->owner_guid != getLoggedInUserGuid()) {
                 $leave_group_url = addTokenToURL(getSiteURL() . "action/LeaveGroup/" . $group->guid);
                 $button .= "<a href='{$leave_group_url}' class='btn btn-danger confirm'>Leave Group</a>";
             }
             $title = $group->title;
             $body = display("pages/group");
             break;
         case "edit":
             $guid = pageArray(2);
             $group = getEntity($guid);
             $title = "Edit " . $group->title;
             $body = drawForm(array("name" => "edit_group", "action" => "editGroup", "method" => "post", "files" => true));
             break;
     }
     $this->html = drawPage(array("header" => $title, "body" => $body, "button" => $button));
 }
コード例 #2
0
 public function __construct()
 {
     $title = $body = $buttons = $breadcrumbs = NULL;
     switch (pageArray(1)) {
         default:
             $body = display("pages/forum");
             $title = "Forum Categories";
             if (adminLoggedIn()) {
                 $add_category_url = getSiteURL() . "forum/add_category";
                 $buttons = "<a href='{$add_category_url}' class='btn btn-danger'>Add a Category</a>";
             }
             $breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"));
             break;
         case 'add_category':
             adminGateKeeper();
             $body = drawForm(array("name" => "add_category", "method" => "post", "action" => "addCategory"));
             $title = "Add a Forum Category";
             break;
         case 'category':
             $guid = pageArray(2);
             if ($guid) {
                 $category = getEntity($guid);
                 $body = display("forum/category");
                 if (loggedIn()) {
                     $add_topic_url = getSiteURL() . "forum/add_topic/{$guid}";
                     $buttons = "<a href='{$add_topic_url}' class='btn btn-success'>Add Topic</a>";
                 }
             }
             $breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"), array("link" => getSiteURL() . "forum/category/" . $category->guid, "label" => $category->title));
             break;
         case "add_topic":
             gateKeeper();
             $category_guid = pageArray(2);
             $category = getEntity($category_guid);
             $body = drawForm(array("name" => "add_topic", "method" => "post", "action" => "addTopic"));
             $title = "Add a topic to {$category->title}";
             break;
         case "topic":
             $topic = getEntity(pageArray(2));
             $category = getEntity($topic->container_guid);
             $breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"), array("link" => getSiteURL() . "forum/category/" . $category->guid, "label" => $category->title), array("link" => getSiteURL() . "forum/topic/" . $topic->guid, "label" => $topic->title));
             $body = display("forum/topic");
             break;
         case "editCategory":
             adminGateKeeper();
             $title = "Edit Forum Category";
             $body = drawForm(array("name" => "edit_category", "method" => "post", "action" => "editCategory'"));
             break;
         case "editTopic":
             adminGateKeeper();
             $title = "Edit Forum Topic";
             $body = drawForm(array("name" => "edit_topic", "method" => "post", "action" => "editTopic"));
             break;
     }
     $this->html = drawPage(array("header" => $title, "body" => $body, "button" => $buttons, "breadcrumbs" => $breadcrumbs));
 }
コード例 #3
0
function displayFullArtists($results)
{
    ?>
	<div class="table-responsive">
		<table class="table table-hover table-striped table-condensed">
			<thead>
			<tr>
				<th>Name</th>
				<th>City</th>
				<th>Website</th>
				<th></th>
			</tr>
			</thead>
			<tbody>
			<?php 
    foreach ($results as $row) {
        $artistid = $row->artistid;
        ?>
				<tr>
					<td><?php 
        echo $row->artistname;
        ?>
</td>
					<td><?php 
        echo $row->city;
        ?>
</td>
					<td><?php 
        echo $row->website;
        ?>
</td>
					<td>
						<?php 
        if (adminLoggedIn()) {
            echo "<a class='btn btn-default' href='edit_artist.php?artist={$artistid}'><span class='glyphicon glyphicon-edit' aria-hidden='true' title='Edit this artist'></span> </a>";
            echo "<a class='btn btn-default' href='delete_artist.php?artist={$artistid}'><span class='glyphicon glyphicon-trash' aria-hidden='true' title='Delete this artist'></span> </a>";
        }
        ?>
					</td>
					<td><?php 
        echo "<a class='btn btn-primary' href='all_albums.php?artist={$artistid}' title='Show albums by this artist'><span class='glyphicon glyphicon-search'></span> </a>";
        ?>
</td>
				</tr>
				<?php 
    }
    ?>
			</tbody>
		</table>
	</div>
	<?php 
}
コード例 #4
0
 public function __construct()
 {
     if (loggedIn()) {
         new MenuItem(array("name" => "profile", "label" => "My Profile", "page" => "profile/" . getLoggedInUserGuid(), "menu" => "my_account", "weight" => 0));
         if (currentPage() == "profile" && pageArray(1) == getLoggedInUserGuid()) {
             new MenuItem(array("name" => "edit_profile", "label" => "Edit Profile", "menu" => "profile", "page" => "editProfile", "list_class" => "active", "link_class" => "list-group-item list-group-item-danger"));
         } elseif (currentPage() == "home" && loggedIn()) {
             new MenuItem(array("name" => "view_my_profile", "label" => "View My Profile", "menu" => "profile", "page" => "profile/" . getLoggedInUserGuid(), "weight" => 10));
             new MenuItem(array("name" => "edit_profile", "label" => "Edit My Profile", "menu" => "profile", "page" => "editProfile", "link_class" => "list-group-item", "weight" => 20));
             if (isEnabledPlugin("members")) {
                 new MenuItem(array("name" => "members", "label" => "Browse Members", "menu" => "profile", "page" => "members", "weight" => 30));
             }
             if (isEnabledPlugin("inviteFriends")) {
                 new MenuItem(array("name" => "invite_friends", "label" => translate("invite_your_friends"), "menu" => "profile", "page" => "members", "weight" => 40));
             }
         }
         if (currentPage() == "profile" && adminLoggedIn()) {
             if (adminLoggedIn()) {
                 $guid = pageArray(1);
                 $user = getEntity($guid);
                 if (is_a($user, "SocialApparatus\\User")) {
                     if (!isAdmin($user)) {
                         new MenuItem(array("name" => "delete", "label" => "Delete User", "page" => "action/deleteUser/{$guid}", "menu" => "profile", "weight" => 100000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
                         new MenuItem(array("name" => "login_as", "label" => "Login As", "page" => "action/loginas/{$guid}", "menu" => "profile", "weight" => 90000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
                         if ($user->banned == "true") {
                             new MenuItem(array("name" => "unban", "label" => "Unban", "page" => "action/unbanUser/{$guid}", "menu" => "profile", "weight" => 80000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
                         } else {
                             new MenuItem(array("name" => "ban", "label" => "Ban", "page" => "action/banUser/{$guid}", "menu" => "profile", "weight" => 80000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
                         }
                     }
                 }
             }
         }
     }
     if (currentPage() == "profile") {
         new CSS("profile", getSitePath() . "core_plugins/profile/assets/css/profile.css");
         new FooterJS('profile', getSiteURL() . 'core_plugins/profile/assets/js/profile.js', 900, true);
     }
     if (currentPage() == "admin") {
         new ViewExtension("admin/tabs", "admin_tabs/profile_fields");
     }
     new ProfileField("first_name", "First Name", "text", false, false, "form-control", "default", 10);
     new ProfileField("last_name", "Last Name", "text", false, false, "form-control", "default", 20);
     new ProfileField("gender", "Gender", "dropdown", array("Male" => "Male", "Female" => "Female"));
     new ProfileField("birthday", "Birthday", "date");
     new ProfileField("about", "About Me", "textarea");
     new ProfileField("hobbies", "Hobbies", "tags");
     new StorageType("User", "about", "text");
     new ViewExtension("profile/right", "profile/activity");
 }
コード例 #5
0
 static function userCanCreateBlog($user = false)
 {
     if (!loggedIn()) {
         return false;
     }
     if (!$user) {
         $user = getLoggedInUser();
     }
     $setting = Setting::get("who_can_create_blogs");
     if (!$setting) {
         $setting = "everyone";
     }
     switch ($setting) {
         case "everyone":
             return true;
             break;
         case "admin_only":
             if (adminLoggedIn()) {
                 return true;
             }
             break;
     }
     return false;
 }
コード例 #6
0
} else {
    $current_category_entity = getEntity(array("type" => "Productcategory", "metadata_name" => "short_name", "metadata_value" => $current_category));
    if (isset($current_category_entity->label)) {
        $current_category = $current_category_entity->short_name;
        $category_label = $current_category_entity->label;
    }
}
if ($current_category_entity) {
    $products = listEntities(array("type" => "Product", "metadata_name" => "container_guid", "metadata_value" => $current_category_entity->guid));
    $description = display("output/editor", array("value" => $current_category_entity->description));
    echo <<<HTML
<div class='col-md-3'>
    <ul class="nav nav-pills nav-stacked">
HTML;
    foreach ($categories as $category) {
        if (!$category->hidden || adminLoggedIn()) {
            $url = getSiteURL() . "store/" . $category->short_name;
            $active = $current_category == $category->short_name ? "active" : "";
            $hidden = $category->hidden ? " (Hidden)" : "";
            echo <<<HTML
<li class='{$active}'><a href='{$url}'>{$category->label} {$hidden}</a></li>
HTML;
        }
    }
    echo <<<HTML
    </ul>    
</div>
HTML;
    echo <<<HTML
<div class='col-md-9'>
    <h2 style='margin-top:0px;'>{$category_label}</h2>
コード例 #7
0
}
//PATCH FOR WINDOWS -- SINCE $_SERVER["REQUEST_URI"] NOT FUNCTIONING ON CERTAIN WINDOWS SERVERS - AUGUST 16, 2005
if (!isset($_SERVER['REQUEST_URI'])) {
    if (isset($_SERVER['SCRIPT_NAME'])) {
        $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    } else {
        $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
    }
    if ($_SERVER['QUERY_STRING']) {
        $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    }
}
//PATCH FOR WINDOWS -- SINCE $_SERVER["REQUEST_URI"] NOT FUNCTIONING ON CERTAIN WINDOWS SERVERS - AUGUST 16, 2005
if (basename($_SERVER["REQUEST_URI"]) != "index.php") {
    if (basename($_SERVER["REQUEST_URI"]) != "staffmain.php") {
        if (adminLoggedIn()) {
            clearAdminSession();
        }
        if (basename($_SERVER["REQUEST_URI"]) != "autocomplete.php" && basename($_SERVER["REQUEST_URI"]) != "cron_send_reply_mail.php") {
            if (!staffLoggedIn()) {
                header("location:index.php");
                exit;
            }
        }
        $rqUri = explode("?", basename($_SERVER["REQUEST_URI"]));
        $rqFl = $rqUri[0];
        if ($_SERVER['HTTP_REFERER'] == "" && (basename($_SERVER["REQUEST_URI"]) != "staffmain.php" || basename($_SERVER["REQUEST_URI"]) != "chatview.php") && basename($_SERVER["REQUEST_URI"]) != "cron_send_reply_mail.php") {
            header("location:staffmain.php");
            exit;
        }
    }
コード例 #8
0
}
if (!isset($_SERVER['REQUEST_URI'])) {
    if (isset($_SERVER['SCRIPT_NAME'])) {
        $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    } else {
        $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
    }
    if ($_SERVER['QUERY_STRING']) {
        $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    }
}
if (basename($_SERVER["REQUEST_URI"]) != "index.php") {
    if (staffLoggedIn()) {
        clearStaffSession();
    }
    if (!adminLoggedIn()) {
        header("location:index.php");
        exit;
    }
    //causes an infinite loop, hence commenting
    /*if ($_SERVER['HTTP_REFERER'] == "" && ((basename($_SERVER["REQUEST_URI"]) != "adminmain.php") || (basename($_SERVER["REQUEST_URI"]) != "chatview.php"))) {
          header("location:adminmain.php");
          exit;
      }*/
}
if (!isset($_SESSION["sess_language"]) or $_SESSION["sess_language"] == "") {
    $_SP_language = "en";
} else {
    $_SP_language = $_SESSION["sess_language"];
}
include "./languages/" . $_SP_language . "/main.php";
コード例 #9
0
 public function __construct()
 {
     gateKeeper();
     $title = $body = $button = $wrapper_class = NULL;
     switch (pageArray(1)) {
         case "view":
             $guid = pageArray(2);
             $video = getEntity($guid);
             if ($video) {
                 if ($video->title) {
                     $title = $video->title;
                 } else {
                     $title = "&nbsp;";
                 }
                 if (getLoggedInUserGuid() == $video->owner_guid || adminLoggedIn()) {
                     $delete_url = addTokenToURL(getSiteURL() . "action/deleteVideo/{$guid}");
                     $button = "<a class='btn btn-info' href='" . getSiteURL() . "videos/edit/{$guid}'>Edit</a>";
                     $button .= "<a class='btn btn-danger confirm' href='{$delete_url}'>Delete</a>";
                 }
                 $body = display("pages/video");
             } else {
                 forward();
             }
             break;
         case "edit":
             $title = "Edit Video Details";
             $body = drawForm(array("name" => "edit_video", "method" => "post", "action" => "editVideo"));
             break;
         case "add":
             $title = "Add a Video";
             $body = drawForm(array("name" => "add_video", "method" => "post", "action" => "AddVideo", "enctype" => "multipart/form-data"));
             break;
         default:
         case "albums":
             switch (pageArray(2)) {
                 default:
                     $guid = pageArray(1);
                     if (!$guid) {
                         $guid = getLoggedInUserGuid();
                     }
                     $user = getEntity($guid);
                     if ($guid == getLoggedInUserGuid()) {
                         $name = "My";
                     } else {
                         $name = $user->full_name . "'s";
                     }
                     $title = $name . " Video Albums";
                     $body = display("pages/video_albums");
                     $button = "<a class='btn btn-success' href='" . getSiteURL() . "videos/albums/add'>Create an Album</a>";
                     break;
                 case "add":
                     $title = "Add a Video Album";
                     $body = drawForm(array("name" => "add_video_album", "method" => "post", "action" => "addVideoalbum", "class" => "add_video_album_form", "enctype" => "multipart/form-data"));
                     break;
                 case "view":
                     $guid = pageArray(3);
                     $album = getEntity($guid);
                     $title = $album->title;
                     $body = display("pages/video_album");
                     $delete_url = getSiteURL() . "action/deleteVideoalbum/{$guid}";
                     $delete_url = addTokenToURL($delete_url);
                     if (getLoggedInUserGuid() == $album->owner_guid || adminLoggedIn()) {
                         $button = "<a class='btn btn-info' href='" . getSiteURL() . "videos/albums/edit/{$guid}'>Edit Album</a>";
                         $button .= "<a class='btn btn-danger' href='{$delete_url}'>Delete Album</a>";
                     }
                     $button .= "<a class='btn btn-success' href='" . getSiteURL() . "videos/add/{$guid}'>Add Video</a>";
                     $wrapper_class = "masonry4col";
                     break;
                 case "edit":
                     $body = drawForm(array("name" => "edit_video_album", "method" => "post", "action" => "editVideoalbum", "enctype" => "multipart/form-data"));
                     $title = "Edit Album";
                     break;
             }
     }
     $this->html = drawPage(array("header" => $title, "body" => $body, "button" => $button, "wrapper_class" => $wrapper_class));
 }
コード例 #10
0
 static function adminGateKeeper()
 {
     if (!loggedIn() || !adminLoggedIn()) {
         new SystemMessage(translate("system_message:not_allowed_to_view"));
         forward("home");
     }
 }
コード例 #11
0
 static function loadDefaultAdmintabs()
 {
     if (adminLoggedIn()) {
         new Admintab("custom_pages");
         new Admintab("general");
         new Admintab("home_page");
         new Admintab("hooks");
         new Admintab("logo");
         new Admintab("plugins");
         new Admintab("seo");
         new Admintab("tables");
         new Admintab("users");
         new Admintab("view_extensions");
     }
     return;
 }
コード例 #12
0
 function __construct()
 {
     $guid = NULL;
     $header = Setting::get("store_name");
     $body = $button = NULL;
     $category = pageArray(1);
     $category_entity = getEntity(array("type" => "Productcategory", "metadata_name" => "short_name", "metadata_value" => $category));
     if ($category_entity) {
         $guid = $category_entity->guid;
     }
     if (!$guid) {
         $first_category = getEntity(array("type" => "Productcategory"));
         if ($first_category) {
             $guid = $first_category->guid;
         }
     }
     if (adminLoggedIn()) {
         $button = "<a href='" . getSiteURL() . "store/create_category' class='btn btn-default'>Create a Category</a>";
         $button .= "<a href='" . getSiteURL() . "store/create_product/{$guid}' class='btn btn-success'>Create Product</a>";
         $button .= "<a href='" . getSiteURL() . "store/edit_category/{$guid}' class='btn btn-info'>Edit Category</a>";
     } else {
         $button = NULL;
     }
     switch (pageArray(1)) {
         case "categories":
         default:
             $body = display("pages/store");
             break;
         case "create_category":
             adminGateKeeper();
             $header = "Create a Category";
             $body = drawForm(array("name" => "create_product_category", "method" => "post", "action" => "CreateProductCategory"));
             break;
         case "create_product":
             adminGateKeeper();
             $guid = pageArray(2);
             $category = getEntity($guid);
             $label = $category->label;
             $header = "Create a new product in the {$label} category";
             $body = drawForm(array("name" => "create_product", "method" => "post", "action" => "CreateProduct", "enctype" => "multipart/form-data"));
             break;
         case "register":
             $header = "Please register to continue.";
             $body = "<h2 class='text-center'>Register</h2>";
             $body .= "<div class='row'>";
             $body .= "<div class='col-md-4 col-md-offset-4'>";
             $body .= drawForm(array("name" => "register", "method" => "post", "action" => "register"));
             $body .= "</div>";
             $body .= "</div>";
             $body .= "<h2 class='text-center'>Already have an account?  <a href='" . getSiteURL() . "login?referer=cart'>Login</a></h2>";
             break;
         case "edit_category":
             $header = "Edit Category";
             $body = drawForm(array("name" => "edit_product_category", "action" => "EditProductCategory", "method" => "post"));
             break;
         case "edit_product":
             $header = "Edit Product";
             $body = drawForm(array("name" => "edit_product", "action" => "EditProduct", "method" => "post", "enctype" => "multipart/form-data"));
             break;
     }
     $this->html = drawPage(array("header" => $header, "body" => $body, "button" => $button));
 }
コード例 #13
0
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse navHeaderCollapse">
			<ul class="navButtons navbar-right">
				<li>
					<a class="btn btn-primary navbar-btn"
					   href="all_record_companies.php"
					   id="navButton1">Record Companies</a>
					<a class="btn btn-success navbar-btn" href="all_artists.php"
					   id="navButton2">Artists</a>
					<a class="btn btn-warning navbar-btn" href="all_albums.php"
					   id="navButton3">Albums</a>
					<?php 
if (!adminLoggedIn() && !custLoggedIn()) {
    echo "<button class='btn btn-danger' id='loginButton'>Login</button>";
} else {
    /*This will redirect to the current page but with the logout querystring. The querystring will be
    		gathered by the access script an dthe user will be logged out. The the url will be parsed by this page and the
    		querystring removed*/
    echo "<a class='btn btn-danger' href='" . $_SERVER['PHP_SELF'] . "?logout=1'>Logout</a>";
}
?>
				</li>
			</ul>
		</div>
	</div>
</div>
<div class="jumbotron text-center" id="jumbo">
	<h1>Welcome to the Music Store</h1>
コード例 #14
0
function displayFullCompanies($result)
{
    ?>
	<div class="table-responsive">
		<table class="table table-hover table-striped table-condensed">
			<thead>
			<tr>
				<th>Name</th>
				<th>City</th>
				<th>Representative</th>
				<th>Rep Email</th>
				<th>Website</th>
				<th></th>
				<th></th>
			</tr>
			</thead>
			<tbody>
			<?php 
    foreach ($result as $row) {
        $compid = $row->companyid;
        ?>
				<tr>
					<td><?php 
        echo $row->companyname;
        ?>
</td>
					<td><?php 
        echo $row->companycity;
        ?>
</td>
					<td><?php 
        echo $row->representative;
        ?>
</td>
					<td><?php 
        echo $row->representativeemail;
        ?>
</td>
					<td><?php 
        echo $row->website;
        ?>
</td>
					<td>
						<?php 
        if (adminLoggedIn()) {
            echo "<a class='btn btn-default' href='edit_record_company.php?recordcompany={$compid}' title='Edit this Company'><span class='glyphicon glyphicon-edit'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t aria-hidden='true'></span> </a>";
            echo "<a class='btn btn-default' href='delete_record_company.php?recordcompany={$compid}' title='Delete this Company'><span class='glyphicon glyphicon-trash'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t aria-hidden='true'></span> </a>";
        }
        ?>
					</td>
					<td><?php 
        echo "<a class='btn btn-primary' href='all_albums.php?recordcompany={$compid}'><span class='glyphicon glyphicon-search' title='Show albums produced by this company'> ";
        ?>
</td>
				</tr>
				<?php 
    }
    ?>
			</tbody>
		</table>
	</div>
	<?php 
}
コード例 #15
0
$guid = Vars::get("guid");
$view_type = Vars::get("view_type");
$heading = $description = $created = NULL;
$entity = getEntity($guid);
$url = $entity->getURL();
$icon = $entity->icon(MEDIUM, "media-object");
$type = $entity->type;
$delete_url = addTokenToURL(getSiteURL() . "action/delete" . $type . "/" . $guid);
$edit_url = getSiteURL() . $type . "/edit/" . $guid;
if (isset($entity->time_created)) {
    $created = display("output/friendly_time", array("timestamp" => $entity->time_created));
}
if (isset($entity->description)) {
    $description = display("output/editor", array("value" => truncate($entity->description)));
}
if (adminLoggedIn() || $entity->owner_guid == $guid) {
    $delete_button = "<a href='{$delete_url}' class='btn btn-danger btn-xs'><i class='fa fa-times'></i></a>";
    $edit_button = "<a href='{$edit_url}' class='btn btn-info btn-xs'><i class='fa fa-pencil'></i></a>";
    $heading = <<<HTML
    <div class="panel-heading clearfix">
        <div class="pull-right">
            {$edit_button}
            {$delete_button}
        </div>
    </div>
HTML;
}
switch ($view_type) {
    default:
    case "list":
        $body = <<<HTML
コード例 #16
0
 static function loggedInUserCanDelete($entity)
 {
     if ($entity->owner_guid) {
         if (getLoggedInUserGuid() == $entity->owner_guid) {
             return true;
         }
         if (adminLoggedIn()) {
             return true;
         }
     }
     return false;
 }