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


PHP gallery::delete_images方法代码示例

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


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

示例1: delete

 /**
  * Delete product
  * @param integer id of product
  * @return void
  */
 public function delete($id)
 {
     // Check user permission
     if (user::is_got()) {
         // Settings
         $this->set_title(Kohana::lang('eshop.delete_product'));
         $this->add_breadcrumb(Kohana::lang('eshop.delete_product'), url::current());
         if ($_POST) {
             if (isset($_POST['yes'])) {
                 // clicked on yes = delete
                 $cat = $this->products->get_product_cat($id);
                 $cat = $cat[0];
                 $status = $this->products->delete_data($id);
                 // Also delte images if deletition was successful
                 if ($status == TRUE) {
                     gallery::delete_images($id, 'products');
                 }
                 url::redirect('/cat/' . $cat . '/' . cat::get_name($cat));
             } else {
                 url::redirect('/product/' . $id . '/' . string::to_url(product::get_name($id)));
             }
         }
         // page
         $this->template->content = new View('admin/product_delete');
     } else {
         url::redirect('/denied');
     }
 }
开发者ID:repli2dev,项目名称:re-eshop,代码行数:33,代码来源:product.php

示例2: delete

 /**
  * Delete page
  * @return void
  * @param id of news
  */
 public function delete($id)
 {
     // Check for user permission
     if (user::is_got()) {
         // Settings
         $this->set_title(Kohana::lang('news.delete_news'));
         $this->add_breadcrumb(Kohana::lang('news.delete_news'), url::current());
         if ($_POST) {
             if (isset($_POST['yes'])) {
                 // clicked on yes = delete
                 $status = $this->news->delete_data($id);
                 // Also delte images if deletition was successful
                 if ($status == TRUE) {
                     gallery::delete_images($id, 'news');
                 }
                 url::redirect('/news');
             } else {
                 url::redirect('/news/detail/' . $id);
             }
         }
         // View
         $this->template->content = new View('admin/news_delete');
     } else {
         url::redirect('/denied');
     }
 }
开发者ID:repli2dev,项目名称:re-eshop,代码行数:31,代码来源:news.php


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