CMS  Version 3.9
edit.inc File Reference

Go to the source code of this file.

Functions

 onDeleteCascade ($blog)
 

Variables

if(!Settings::checkPermission("settings", "editor_roles")) $blog_id = checkNumeric($_GET["blog_id"])
 
 $blog = new Blog()
 
 $menu_item = "Blogs"
 
if($blog_idelse
 
 $_POST ["owner_id"] = $user->get($user->getPrimaryKey())
 
 $_POST ["created_date"] = now()
 
 $blogView = new BlogView($blog)
 
 $form = BlogManager::buildBlogForm($blog, $redirect, $blogView)
 
$form action = "/action/blog/edit?blog_id={$blog_id}"
 
$form allowDelete = $blog->allowDelete()
 
$form onDelete = onDeleteCascade
 
if($method=="POST") $script = $form->writeScript()
 

Function Documentation

◆ onDeleteCascade()

onDeleteCascade (   $blog)

Definition at line 89 of file edit.inc.

90 {
91  $blog->delete();
92  redirect("/admin/blogs");
93 }
$blog
Definition: edit.inc:44

Variable Documentation

◆ $_POST [1/2]

$_POST["created_date"] = now()

Definition at line 58 of file edit.inc.

◆ $_POST [2/2]

$_POST["owner_id"] = $user->get($user->getPrimaryKey())

Definition at line 57 of file edit.inc.

◆ $blog

$blog = new Blog()

Definition at line 44 of file edit.inc.

◆ $blog_id

if (!Settings::checkPermission("settings", "editor_roles")) $blog_id = checkNumeric($_GET["blog_id"])

Definition at line 42 of file edit.inc.

◆ $blogView

$blogView = new BlogView($blog)

Definition at line 61 of file edit.inc.

◆ $form

$form = BlogManager::buildBlogForm($blog, $redirect, $blogView)

Definition at line 62 of file edit.inc.

◆ $menu_item

$menu_item = "Blogs"

Definition at line 46 of file edit.inc.

◆ $script

if ( $method=="POST") $script = $form->writeScript()

Definition at line 86 of file edit.inc.

◆ action

$form action = "/action/blog/edit?blog_id={$blog_id}"

Definition at line 64 of file edit.inc.

◆ allowDelete

$form allowDelete = $blog->allowDelete()

Definition at line 68 of file edit.inc.

◆ else

if ( $blog_id) else
Initial value:
{
$title = "Add a new Blog"

Definition at line 53 of file edit.inc.

◆ onDelete

$form onDelete = onDeleteCascade

Definition at line 69 of file edit.inc.