Code:
function deleteContent ($array) {
if (array_key_exists('Remove Pages', $this->groupperms) && (array_key_exists('Modify Any Page', $this->groupperms)) && (!$this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
} else
{
if (!array_key_exists('Remove Pages', $this->groupperms) && (!array_key_exists('Modify Any Page', $this->groupperms)) && (!$this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
} else
{
if (!array_key_exists('Remove Pages', $this->groupperms) && (!array_key_exists('Modify Any Page', $this->groupperms)) && ($this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
} else
{
if (array_key_exists('Remove Pages', $this->groupperms) && (array_key_exists('Modify Any Page', $this->groupperms)) && ($this->CI->contentmodel->hasChild($array['content_id']))) {
return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
}
}
}
}
}