Exemplo n.º 1
0
<?php

//Include necessary files
include_once '../includes/core/init.inc.php';
$my_session->confirm_logged_in();
?>

<?php 
$current_subject = subject::find_subject_by_id($_GET["subject"], false);
?>

<?php 
if (!$current_subject) {
    // subject ID was missing or invlid or
    // subject couldn't be found in database
    utility::redirect_to("manage_content.php");
}
subject::delete_subject($current_subject["id"]);
ob_end_flush();
Exemplo n.º 2
0
 /**
  * according to user active, to find current subject and current page user want to visit
  * @param boolean context @var 
  */
 public static function find_selected_content($public = false)
 {
     global $current_subject;
     global $current_page;
     if (isset($_GET["subject"])) {
         $current_subject = subject::find_subject_by_id($_GET["subject"], $public);
         if ($current_subject && $public) {
             $current_page = page::find_default_page_for_subject($current_subject["id"]);
         } else {
             $current_page = null;
         }
     } else {
         if (isset($_GET["page"])) {
             $current_page = page::find_page_by_id($_GET["page"], $public);
             $current_subject = null;
         } else {
             $current_subject = null;
             $current_page = null;
         }
     }
 }