Exemple #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;
     }
     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';
     //$this->updateCache($this->options['path'], $this->_stat($this->options['path']));
     return true;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #4
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->mydirname = $mydirname = $this->options['mydirname'];
     $langmanpath = XOOPS_TRUST_PATH . '/libs/altsys/class/D3LanguageManager.class.php';
     if (!file_exists($langmanpath)) {
         return false;
     }
     require_once $langmanpath;
     $langman =& D3LanguageManager::getInstance();
     $langman->read('main.php', $mydirname, 'd3diary');
     $d3dTrustDir = XOOPS_TRUST_PATH . '/modules/d3diary';
     include_once $d3dTrustDir . '/class/d3diaryConf.class.php';
     $this->d3dConf =& D3diaryConf::getInstance($mydirname, 0, 'photolist');
     if (!is_object($this->d3dConf)) {
         return false;
     }
     xoops_elFinder::dbSetCharset('utf8');
     // make catgory tree
     $func =& $this->d3dConf->func;
     $uid = $this->d3dConf->uid;
     $cat = $func->get_categories($uid, $uid);
     $this->catTree = array();
     $this->catTree['root'] = array('subcats' => array());
     $pcid = 'root';
     foreach ($cat as $_cat) {
         if (100 <= $_cat['blogtype'] || $_cat['subcat'] && !$_cat['num']) {
             continue;
         }
         $this->catTree[$_cat['cid']] = array('subcats' => array(), 'num' => $_cat['num'], 'name' => $_cat['cname'], 'pcid' => $_cat['subcat'] && $pcid ? $pcid : 'root');
         if ($_cat['subcat']) {
             if ($pcid !== 'root') {
                 $this->catTree[$pcid]['subcats'][$_cat['cid']] = $_cat['cname'];
             }
         } else {
             if ($pcid !== 'root' && !$this->catTree[$pcid]['subcats'] && !$this->catTree[$pcid]['num']) {
                 // no entry
                 unset($this->catTree[$this->catTree[$pcid]['pcid']]['subcats'][$pcid], $this->catTree[$pcid]);
             }
             $pcid = $_cat['cid'];
             $this->catTree['root']['subcats'][$pcid] = $_cat['cname'];
         }
     }
     if (!isset($this->options['extAnother']) || strtolower($this->options['extAnother']) !== 'off') {
         if (!isset($this->catTree[0])) {
             $this->catTree[0] = array('subcats' => array(), 'name' => _MD_NOCNAME, 'pcid' => 'root');
             $this->catTree['root']['subcats'][0] = $this->strToUTF8(_MD_NOCNAME);
         }
         $this->catTree[0]['name'] = $this->strToUTF8($this->catTree[0]['name']);
         $this->catTree[-1] = array('subcats' => array(), 'name' => 'Another', 'pcid' => 0);
         $this->catTree[0]['subcats'][-1] = 'Another';
     }
     if (is_null($this->options['syncChkAsTs'])) {
         $this->options['syncChkAsTs'] = true;
     }
     return true;
 }