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


PHP Files::delete_file方法代码示例

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


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

示例1: filter_images

 /**
  * return formated files and delete updated files
  */
 public function filter_images($entries_files = null, $field_files = null)
 {
     $this->CI->load->library('files/files');
     if ($entries_files) {
         $entries_parts = explode('|', $entries_files);
         $field_parts = explode('|', $field_files);
         if (is_array($entries_parts) && count($entries_parts) > 0) {
             foreach ($entries_parts as $field) {
                 if (!in_array($field, (array) $field_parts)) {
                     Files::delete_file($field);
                 }
             }
             return $field_parts;
         }
         return null;
     } else {
         return null;
     }
 }
开发者ID:jacksun101,项目名称:PyroAddons,代码行数:22,代码来源:field.multiimage.php

示例2: delete_file

 /**
  * Delete a file
  *
  * @access	public
  * @return	void
  */
 public function delete_file()
 {
     // this is just a safeguard if they circumvent the JS permissions
     if (!in_array('delete_file', Files::allowed_actions())) {
         show_error(lang('files:no_permissions'));
     }
     if ($id = $this->input->post('file_id')) {
         $result = Files::delete_file($id);
         $result['status'] and Events::trigger('file_deleted', $id);
         echo json_encode($result);
     }
 }
开发者ID:blekedeg,项目名称:lbhpers,代码行数:18,代码来源:admin.php

示例3: 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;
     }
 }
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:28,代码来源:products_m.php

示例4: save_gallery_images

 /**
  * Save / Upload gallery images
  * 
  * @param string $type insert|update
  * @param int $gallery_id 
  * @return bool
  */
 private function save_gallery_images($type = 'insert', $gallery_id)
 {
     if (!is_numeric($gallery_id)) {
         return FALSE;
     }
     $folder_id = $this->gallery_m->get($gallery_id)->folder_id;
     $max_images = $this->input->post('max_images');
     $image_name = $this->current_user->username . "Image ";
     $img_data = NULL;
     $img_id = array();
     for ($i = 1; $i <= $max_images; $i++) {
         $img = Files::upload($folder_id, $image_name . $i, $field = 'image' . $i, $width = 800, $height = 800, $ratio = TRUE);
         if ($img['status'] === TRUE) {
             $img_data = array('gallery_id' => $gallery_id, 'file_id' => $img['data']['id']);
             if ($file_id = $this->input->post('image' . $i)) {
                 Files::delete_file($file_id);
                 $img_id[] = $this->gallery_image_m->update_by('file_id', $file_id, $img_data);
             } else {
                 $img_id[] = $this->gallery_image_m->insert($img_data);
             }
         }
     }
     return count($img_id);
 }
开发者ID:jacksun101,项目名称:PyroAddons,代码行数:31,代码来源:myaccess.php

示例5: Files

<?php

require 'checkallowed.php';
// No direct access
$url_id = $GPXIN['id'];
$url_do = $GPXIN['do'];
$file_name = $GPXIN['file'];
require DOCROOT . '/includes/classes/files.php';
$Files = new Files();
// Delete a file
if ($url_do == 'delete') {
    echo $Files->delete_file($url_id, $file_name);
} elseif ($url_do == 'delete_dir') {
    echo $Files->delete_dir($url_id, $file_name);
} elseif ($url_do == 'savecontent') {
    if (empty($url_id) || empty($file_name)) {
        die('No ID or filename given!');
    }
    $file_content = $GPXIN['content'];
    echo $Files->save_file($url_id, $file_name, $file_content);
    exit;
} elseif ($url_do == 'show_addfile') {
    echo '<b>' . $lang['new_filename'] . ':</b> <input type="text" class="inputs" id="newfilename" /><br />
    <textarea id="filecontent" class="txteditor" style="width:715px;height:370px;white-space:pre;"></textarea><br />
    <div align="center"><div class="button" onClick="javascript:file_savenewfile(' . $url_id . ');">' . $lang['save'] . '</div></div>';
    exit;
} elseif ($url_do == 'show_add_dir') {
    echo '<b>' . $lang['new_dirname'] . ':</b> <input type="text" class="inputs" id="new_dirname" /><br />
    <div align="center"><div class="button" onClick="javascript:file_add_newdir(' . $url_id . ');">' . $lang['save'] . '</div></div>';
    exit;
} elseif ($url_do == 'create_newdir') {
开发者ID:milecar91,项目名称:GamePanelX-V3,代码行数:31,代码来源:file_actions.php

示例6: delete_file

 /**
  * Delete a file
  *
  * @access	public
  * @return	void
  */
 public function delete_file()
 {
     // this is just a safeguard if they circumvent the JS permissions
     if (!in_array('delete_file', Files::allowed_actions())) {
         show_error(lang('files:no_permissions'));
     }
     if ($id = $this->input->post('file_id')) {
         echo json_encode(Files::delete_file($id));
     }
 }
开发者ID:gamchantoi,项目名称:sisfo-ft,代码行数:16,代码来源:admin.php

示例7: field_assignment_destruct

 /**
  * Deletes the table and clean files
  * @param type $field
  * @param type $stream
  */
 public function field_assignment_destruct($field, $stream)
 {
     $this->CI->load->library('files/files');
     $table_data = $this->_table_data($field, $stream);
     /** first lets get the images that we need to delete * */
     $rows = $this->CI->db->get($table_data->table)->result();
     /** lets remove the files * */
     foreach ($rows as $r) {
         Files::delete_file($r->{$table_data->file_id_column});
     }
     /** Drop the table! * */
     $this->CI->dbforge->drop_table($table_data->table);
 }
开发者ID:tonybolanyo,项目名称:PyroCMS-Multiple-Images-FieldType,代码行数:18,代码来源:field.multiple_images.php


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