Skip to content

Instantly share code, notes, and snippets.

@marcoscoelho
Created August 8, 2011 20:16
Show Gist options
  • Save marcoscoelho/1132619 to your computer and use it in GitHub Desktop.
Save marcoscoelho/1132619 to your computer and use it in GitHub Desktop.
Helper file of the "Files module" to PyroCMS
<?php defined('BASEPATH') OR exit('No direct script access allowed.');
/**
* CodeIgniter Files Helpers
*
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
* @author PyroCMS development team
*/
// ------------------------------------------------------------------------
function get_file_folders()
{
ci()->load->model('files/file_folders_m');
$folders_tree = ci()->file_folders_m->get_folders();
$arr = array('0=' . lang('select.pick'));
foreach ($folders_tree as $id => $folder)
{
$arr[] = $id . '=' . str_repeat('&raquo; ', $folder->depth) . $folder->name;
}
return $arr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment