Example #1
0
 /**
  * Prepare driver before mount volume.
  * Connect to db, check required tables and fetch root path
  *
  * @return bool
  * @author Dmitry (dio) Levashov
  **/
 protected function init()
 {
     $this->db =& XoopsDatabaseFactory::getDatabaseConnection();
     if (!is_object($this->db)) {
         return false;
     }
     mysql_set_charset('utf8');
     $this->mydirname = $this->options['mydirname'];
     $this->tbc = $this->db->prefix($this->mydirname) . '_cat';
     $this->tbf = $this->db->prefix($this->mydirname) . '_photos';
     //$this->updateCache($this->options['path'], $this->_stat($this->options['path']));
     return true;
 }
Example #2
0
 /**
  * Prepare driver before mount volume.
  * Connect to db, check required tables and fetch root path
  *
  * @return bool
  * @author Dmitry (dio) Levashov
  **/
 protected function init()
 {
     $this->db =& XoopsDatabaseFactory::getDatabaseConnection();
     if (!is_object($this->db)) {
         return false;
     }
     xoops_elFinder::dbSetCharset('utf8');
     $this->mydirname = $this->options['mydirname'];
     $this->tbc = $this->db->prefix($this->mydirname) . '_cat';
     $this->tbf = $this->db->prefix($this->mydirname) . '_photos';
     if (is_null($this->options['syncChkAsTs'])) {
         $this->options['syncChkAsTs'] = true;
     }
     return true;
 }
Example #3
0
 /**
  * Prepare driver before mount volume.
  * Connect to db, check required tables and fetch root path
  *
  * @return bool
  * @author Dmitry (dio) Levashov
  **/
 protected function init()
 {
     $this->db =& XoopsDatabaseFactory::getDatabaseConnection();
     if (!$this->db) {
         return false;
     }
     xoops_elFinder::dbSetCharset('utf8');
     $this->mydirname = $this->options['mydirname'];
     $this->tbf = $this->db->prefix($this->mydirname) . '_file';
     $module_handler =& xoops_gethandler('module');
     $XoopsModule =& $module_handler->getByDirname($this->mydirname);
     $module = $XoopsModule->getInfo();
     $this->x_mid = $XoopsModule->getVar('mid');
     global $xoopsUser;
     if (is_object($xoopsUser)) {
         $this->x_uid = $xoopsUser->getVar('uid');
         $this->x_uname = $this->strToUTF8($xoopsUser->uname('n'));
         $this->x_groups = $xoopsUser->getGroups();
         $this->x_isAdmin = !empty($_REQUEST['admin']) && $xoopsUser->isAdmin($this->x_mid);
     } else {
         $this->x_uid = 0;
         $this->x_groups = array(XOOPS_GROUP_ANONYMOUS);
     }
     if (is_null($this->options['syncChkAsTs'])) {
         $this->options['syncChkAsTs'] = true;
     }
     return true;
 }