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


PHP Layout::Copy方法代码示例

本文整理汇总了PHP中Layout::Copy方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::Copy方法的具体用法?PHP Layout::Copy怎么用?PHP Layout::Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Layout的用法示例。


在下文中一共展示了Layout::Copy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Copy

 /**
  * Copys a layout
  */
 public function Copy()
 {
     // 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();
     $layoutid = Kit::GetParam('layoutid', _POST, _INT);
     $layout = Kit::GetParam('layout', _POST, _STRING);
     $description = Kit::GetParam('description', _POST, _STRING);
     $copyMedia = Kit::GetParam('copyMediaFiles', _POST, _CHECKBOX);
     Kit::ClassLoader('Layout');
     $layoutObject = new Layout($db);
     if (!$layoutObject->Copy($layoutid, $layout, $description, $user->userid, (bool) $copyMedia)) {
         trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
     }
     $response->SetFormSubmitResponse(__('Layout Copied'));
     $response->Respond();
 }
开发者ID:rovak73,项目名称:xibo-cms,代码行数:24,代码来源:layout.class.php

示例2: LayoutCopy

 /**
  * Copy Layout
  * @return <XiboAPIResponse>
  */
 public function LayoutCopy()
 {
     if (!$this->user->PageAuth('layout')) {
         return $this->Error(1, 'Access Denied');
     }
     Kit::ClassLoader('Layout');
     $layout = new Layout();
     $layoutId = $this->GetParam('layoutId', _INT);
     $name = $this->GetParam('layout', _STRING);
     $description = $this->GetParam('description', _STRING);
     $copyMedia = $this->GetParam('copyMedia', _INT);
     if (!$this->user->LayoutAuth($layoutId)) {
         return $this->Error(1, 'Access Denied');
     }
     // Copy this layout
     $layoutObject = new Layout();
     if (!($id = $layoutObject->Copy($layoutId, $name, $description, $this->user->userid, $copyMedia))) {
         return $this->Error($layoutObject->GetErrorNumber(), $layoutObject->GetErrorMessage());
     }
     Debug::LogEntry('audit', 'Copied layout with id' . $id);
     return $this->Respond($this->ReturnId('layout', $id));
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:26,代码来源:rest.class.php

示例3: AddTemplate

 /**
  * Adds a template
  * @return 
  */
 function AddTemplate()
 {
     // 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();
     $template = Kit::GetParam('template', _POST, _STRING);
     $tags = Kit::GetParam('tags', _POST, _STRING);
     $description = Kit::GetParam('description', _POST, _STRING);
     $templateLayoutId = Kit::GetParam('layoutid', _POST, _INT);
     // Copy the layout and adjust the values of the new layout
     $layoutObject = new Layout();
     if (!($layoutId = $layoutObject->Copy($templateLayoutId, $template, $description, $user->userid, true))) {
         trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
     }
     // Tag it
     if ($tags != '') {
         // Create an array out of the tags
         $tagsArray = explode(',', $tags);
         $tagsArray[] = 'template';
     } else {
         $tagsArray = array('template');
     }
     // Add the tags XML to the layout
     $layoutObject->EditTags($layoutId, $tagsArray);
     $response->SetFormSubmitResponse('Template Added.');
     $response->Respond();
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:35,代码来源:template.class.php


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