public function __construct() { // call parent constuctor parent::__construct(); // Check if file to display is set if (isset($_GET['show'])) { $this->filename = $_GET['show']; } // Check if file is to be deleted if (isset($_GET['delfile'])) { $this->delete(); } // Get the path to the target file if ($this->filename != "../main.js") { $this->filename = "../site-assets/js/" . $this->filename; } else { $this->homeclass = 'label label-info'; $this->deletebtn = '<a href="scripts.php?delfile=' . $this->filename . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>'; } // Check if layout file is present if (!file_exists($this->filename)) { header('HTTP/1.1 400 BAD REQUEST'); die('Javascript not Found !<br><a href="scripts.php"> click here for scripts</a>'); } // get the contents of the controller file (index.php) $this->content = htmlspecialchars(file_get_contents($this->filename)); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } //Build the HTML Treeview $this->buildTree(); // Get the Message to display if any $this->getMessage(); }
public function __construct() { // call parent constuctor parent::__construct(); // Check if file to display is set if (isset($_GET['show'])) { $this->filename = 'layout.' . $_GET['show']; } // Check if file is to be deleted if (isset($_GET['delfile'])) { $this->delete(); } // Check if layout file is present if (!file_exists('../' . $this->filename)) { header('HTTP/1.1 400 BAD REQUEST'); die('Layout not Found !<br><a href="layouts.php"> click here for layouts</a>'); } // get the contents of the layout file $this->content = htmlspecialchars(file_get_contents('../' . $this->filename)); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } // Set selected class on home node if defaults file if ($this->filename == "layout.php") { $this->homeclass = 'label label-info'; } else { $this->deletebtn = '<a href="layouts.php?delfile=' . $this->filename . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>'; } //Build the HTML Treeview $this->buildTree(); // Get the Message to display if any $this->getMessage(); }
public function __construct() { // call parent constuctor parent::__construct(); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } }
public function __construct() { // call parent constuctor parent::__construct(); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } // Get the Message to display if any $this->getMessage(); }
public function __construct() { // call parent constuctor parent::__construct(); // get the contents of the controller file (index.php) $this->content = htmlspecialchars(file_get_contents("../index.php")); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } // Get the Message to display if any $this->getMessage(); }
public function __construct() { // call parent constuctor parent::__construct(); // Update the user if Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } // Check if delete ID is set if (isset($_GET['delid'])) { $this->delete(); } // Check if user to display is set if (isset($_GET['id'])) { $this->id = $_GET['id']; } if ($this->id != 'new') { $this->thisUser = $this->query('SELECT * FROM `users` WHERE `id` = ' . $this->id . ' LIMIT 1')->fetch(PDO::FETCH_ASSOC); // get the selected user details $this->setOptions('active', 'User is Active.', 'Inactive user cannot login.'); $this->setOptions('editpage', 'Page management available.', 'Page management blocked.'); $this->setOptions('delpage', 'Page delete available.', 'Page delete blocked.'); $this->setOptions('edituser', 'User can manage other users.', 'User cannot manage other users.'); $this->setOptions('deluser', 'User can delete other users.', 'User cannot delete other users.'); $this->setOptions('editsettings', 'Template Settings management available.', 'Template Settings management blocked.'); $this->setOptions('editcont', 'Template Controller management available.', 'Template Controller management blocked.'); $this->setOptions('editlayout', 'Template Layout management available.', 'Template Layout management blocked.'); $this->setOptions('editcss', 'Stylesheet management available.', 'Stylesheet management blocked.'); $this->setOptions('editjs', 'Javascript management available.', 'Javascript management blocked.'); $this->barBtns = '<input type="submit" name="Submit" class="btn btn-inverse" value="Save Changes"> <a href="?id=new" class="btn btn-inverse">New User</a>'; if ($this->id != 1) { $this->barBtns .= ' <a href="scripts/del-user.php?delid=' . $this->id . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>'; } } else { $this->barBtns = '<input type="submit" name="Submit" class="btn btn-inverse" value="Add New">'; } //Build the HTML Treeview $this->buildTree(); // Get the Message to display if any $this->getMessage(); }
public function __construct() { // call parent constuctor parent::__construct(); // Update the Controller of Posted if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->update(); } // Check if file to display is set if (isset($_GET['id'])) { $this->id = $_GET['id']; } if ($this->id != 'new') { $this->page = $this->query('SELECT * FROM `pages` WHERE `id` = ' . $this->id . ' LIMIT 1')->fetch(PDO::FETCH_ASSOC); // get the selected user details $this->setOptions('published', 'Page is published and visible to all.', 'Unpublished page only visible when logged in.'); } //Build the HTML Treeview $this->buildTree(); // Get the Message to display if any $this->getMessage(); }