本文整理汇总了PHP中Layout::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::Delete方法的具体用法?PHP Layout::Delete怎么用?PHP Layout::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::Delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TemplateDelete
/**
* Delete Template
* @return <XiboAPIResponse>
*/
public function TemplateDelete()
{
if (!$this->user->PageAuth('template')) {
return $this->Error(1, 'Access Denied');
}
$layout = new Layout();
$layoutId = $this->GetParam('templateId', _INT);
if (!$this->user->LayoutAuth($layoutId)) {
return $this->Error(1, 'Access Denied');
}
if (!$layout->Delete($layoutId)) {
return $this->Error($layout->GetErrorNumber(), $layout->GetErrorMessage());
}
return $this->Respond($this->ReturnId('success', true));
}
示例2: DeleteTemplate
/**
* Deletes a template
* @return
*/
function DeleteTemplate()
{
// Check the token
if (!Kit::CheckToken()) {
trigger_error(__('Sorry the form has expired. Please refresh.'), E_USER_ERROR);
}
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$templateId = Kit::GetParam('templateId', _POST, _INT);
if ($templateId == 0) {
trigger_error(__('No template selected'), E_USER_ERROR);
}
// Is this user allowed to delete this template?
$auth = $this->user->TemplateAuth($templateId, true);
if (!$auth->del) {
trigger_error(__('Access denied'), E_USER_ERROR);
}
// Use the data class
$template = new Layout();
// Delete the template
if (!$template->Delete($templateId)) {
trigger_error($template->GetErrorMessage(), E_USER_ERROR);
}
$response->SetFormSubmitResponse(__('The Template has been Deleted'));
$response->Respond();
}
示例3: delete
/**
* Deletes a layout record from the DB
*/
function delete()
{
// Check the token
if (!Kit::CheckToken()) {
trigger_error(__('Sorry the form has expired. Please refresh.'), E_USER_ERROR);
}
$response = new ResponseManager();
$layoutId = Kit::GetParam('layoutid', _POST, _INT, 0);
if (!$this->auth->del) {
trigger_error(__('You do not have permissions to delete this layout'), E_USER_ERROR);
}
$layoutObject = new Layout();
if (!$layoutObject->Delete($layoutId)) {
trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
}
$response->SetFormSubmitResponse(__('The Layout has been Deleted'));
$response->Respond();
}
示例4: LayoutDelete
/**
* Delete Layout
* @return <XiboAPIResponse>
*/
public function LayoutDelete()
{
if (!$this->user->PageAuth('layout')) {
return $this->Error(1, 'Access Denied');
}
Kit::ClassLoader('Layout');
$layout = new Layout($this->db);
$layoutId = $this->GetParam('layoutId', _INT);
if (!$this->user->LayoutAuth($layoutId)) {
return $this->Error(1, 'Access Denied');
}
if (!$layout->Delete($layoutId)) {
return $this->Error($layout->GetErrorNumber(), $layout->GetErrorMessage());
}
return $this->Respond($this->ReturnId('success', true));
}