コード例 #1
0
ファイル: Design.php プロジェクト: ngardner/BentoCMS
 function actionDeletelayout($params = '')
 {
     if (!empty($params['layout_id'])) {
         $objLayouts = new LayoutModel();
         if ($objLayouts->safeToDelete($params['layout_id'])) {
             $objLayouts->deleteLayout($params['layout_id']);
             $this->messages[] = array('type' => 'success', 'message' => 'Layout has been deleted.');
         } else {
             $this->messages[] = array('type' => 'error', 'message' => 'Cannot delete. There are still pages assigned to this layout.');
         }
     } else {
         $this->messages[] = array('type' => 'error', 'message' => 'Unknown layout to delete.');
     }
     $this->actionLayouts();
 }