public function __construct($config_name = 'filebrowser') { $this->config = Kohana::config($config_name); $this->config_name = $config_name; $this->filekind = FileKind::instance(); $this->folder = $this->config['directory']; // check and update the updated_since settings $this->_updated_since(); $this->_sort_order(); }
public function __construct() { parent::__construct(); $this->session = Session::instance(); require Kohana::find_file('vendor', 'classTextile'); require Kohana::find_file('vendor', 'Markdown'); $this->auth = Auth::instance(); $this->access = Access::instance(); $this->filebrowser = Filebrowser::instance(); $this->filekind = FileKind::instance(); Subfolio::set_filebrowser($this->filebrowser); Subfolio::set_auth($this->auth); Subfolio::set_template($this->template); Subfolio::set_filekind($this->filekind); $this->template->site_title = Kohana::config('filebrowser.site_name'); $this->template->page_title = ""; }
public static function listingKindCmpDesc($a, $b) { $a_kind = ""; $b_kind = ""; if ($a->kind) { if (is_string($a->kind)) { $kind = FileKind::instance()->get_kind_by_extension($a->kind); if ($kind && isset($kind['display'])) { $a_kind = $kind['display']; } } else { if (is_array($a->kind)) { $a_kind = $a->kind['display']; } } } if ($b->kind) { if (is_string($b->kind)) { $kind = FileKind::instance()->get_kind_by_extension($b->kind); if ($kind && isset($kind['display'])) { $b_kind = $kind['display']; } } else { if (is_array($b->kind)) { $b_kind = $b->kind['display']; } } } return strcmp(strtolower($b_kind), strtolower($a_kind)); }