当前位置: 首页>>代码示例>>PHP>>正文


PHP Layout::Delete方法代码示例

本文整理汇总了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));
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:19,代码来源:rest.class.php

示例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();
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:31,代码来源:template.class.php

示例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();
 }
开发者ID:rovak73,项目名称:xibo-cms,代码行数:21,代码来源:layout.class.php

示例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));
 }
开发者ID:abbeet,项目名称:server39,代码行数:20,代码来源:rest.class.php


注:本文中的Layout::Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。