本文整理汇总了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');
}
}
示例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');
}
}