本文整理汇总了PHP中Files::delete_folder方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::delete_folder方法的具体用法?PHP Files::delete_folder怎么用?PHP Files::delete_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Files
的用法示例。
在下文中一共展示了Files::delete_folder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_folder
/**
* Delete an empty folder
*/
public function delete_folder()
{
// this is just a safeguard if they circumvent the JS permissions
if (!in_array('delete_folder', Files::allowed_actions())) {
show_error(lang('files:no_permissions'));
}
if ($id = $this->input->post('folder_id')) {
$result = Files::delete_folder($id);
$result['status'] and Events::trigger('file_folder_deleted', $id);
echo json_encode($result);
}
}
示例2: delete_product
/**
* Deletes a product, the images and Files folder related to it.
*
* @param integer $id The Product ID to delete
* @return boolean TRUE or FALSE on success of failure
* @access public
*/
public function delete_product($id)
{
$product = $this->get_product($id);
if ($this->db->delete('firesale_products', array('id' => $id))) {
// Remove files folder
if ($product !== FALSE) {
$folder = $this->get_file_folder_by_slug($product->slug);
if ($folder != FALSE) {
$images = Files::folder_contents($folder->id);
$images = $images['data']['file'];
foreach ($images as $image) {
Files::delete_file($image->id);
}
Files::delete_folder($folder->id);
}
}
return TRUE;
} else {
return FALSE;
}
}
示例3: uninstall
public function uninstall()
{
$this->load->driver('Streams');
$this->load->library('files/files');
// Delete the Uploads folder and remove its ID in the settings table
Files::delete_folder(Settings::get($this->module_name . '_folder'));
$this->db->delete('settings', array('module' => $this->module_name));
// Remove Streams News
$this->streams->utilities->remove_namespace($this->module_name);
return true;
}
示例4: uninstall
public function uninstall()
{
// Load required items
$this->load->driver('Streams');
$this->load->model('firesale/categories_m');
$this->load->model('firesale/products_m');
$this->load->library('files/files');
// Remove settings
$this->settings('remove');
// Remove email templates
$this->templates('remove');
// Remove products
$this->products_m->delete_all_products();
// Remove files folder
$folder = $this->products_m->get_file_folder_by_slug('product-images');
if ($folder != FALSE) {
Files::delete_folder($folder->id);
}
// Remove streams
$this->streams->utilities->remove_namespace('firesale_categories');
$this->streams->utilities->remove_namespace('firesale_products');
$this->streams->utilities->remove_namespace('firesale_gateways');
$this->streams->utilities->remove_namespace('firesale_addresses');
$this->streams->utilities->remove_namespace('firesale_orders');
$this->streams->utilities->remove_namespace('firesale_orders_items');
// Drop the payment gateway tables
$this->dbforge->drop_table('firesale_products_firesale_categories');
// Streams doesn't auto-remove it =/
$this->dbforge->drop_table('firesale_gateway_settings');
$this->dbforge->drop_table('firesale_order_items');
$this->dbforge->drop_table('firesale_transactions');
// Return
return TRUE;
}
示例5: delete_folder
/**
* Delete an empty folder
*/
public function delete_folder()
{
// this is just a safeguard if they circumvent the JS permissions
if (!in_array('delete_folder', Files::allowed_actions())) {
show_error(lang('files:no_permissions'));
}
if ($id = $this->input->post('folder_id')) {
echo json_encode(Files::delete_folder($id));
}
}