forked from egbot/Symbiota
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from bryo-lichen/revert-39-revert-38-master
Revert "Revert "Merge Symbiota-light developments into bryo-lichen code repo""
- Loading branch information
Showing
71 changed files
with
1,158 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
/config/dbconnection.php | ||
/config/symbini.php | ||
/footer.php | ||
/header.php | ||
/leftmenu.php | ||
/index.php | ||
content/lang/header.en.php | ||
content/lang/header.es.php | ||
content/lang/index.en.php | ||
content/lang/index.es.php | ||
includes/header.php | ||
includes/footer.php | ||
includes/head.php | ||
includes/leftmenu.php | ||
includes/spprofilehead.php | ||
includes/usagepolicy.php | ||
css/main.css | ||
css/speciesprofile.css | ||
|
||
config/symbini.php | ||
config/dbconnection.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
class ImageDropbox extends Manager { | ||
|
||
private $collid; | ||
private $collMetaArr; | ||
private $dropboxApiUrl = 'https://api.dropboxapi.com/2/files/list_folder'; | ||
private $authKey; | ||
private $basePath = '/Images/Global/'; | ||
|
||
public function __construct($connType = 'write'){ | ||
parent::__construct(null,$connType); | ||
} | ||
|
||
public function __destruct(){ | ||
parent::__destruct(); | ||
} | ||
|
||
public function processImages(){ | ||
if($this->collMetaArr){ | ||
$collPath = $this->basePath.$this->collMetaArr['instcode']; | ||
if($this->collMetaArr['collcode']) $collPath .= '-'.$this->collMetaArr['collcode']; | ||
$fileListObj = json_encode($this->getFileList(getFileList($targetPath))); | ||
|
||
} | ||
} | ||
|
||
//Data functions | ||
public function setCollMeta(){ | ||
if($this->collid){ | ||
$sql = 'SELECT institutioncode, collectioncode, collectionname FROM omcollections WHERE collid = '.$this->collid; | ||
$rs = $this->conn->query($sql); | ||
while($r = $rs->fetch_object()){ | ||
$this->collMetaArr['instcode'] = $r->institioncode; | ||
$this->collMetaArr['collcode'] = $r->collectioncode; | ||
$this->collMetaArr['collname'] = $r->collectionname; | ||
} | ||
$rs->free(); | ||
} | ||
} | ||
|
||
//DropBox API calls | ||
private function getFileList($targetPath){ | ||
$listJson = ''; | ||
$ch = curl_init($this->dropboxApiUrl); | ||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); | ||
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json','Authorization: Bearer')); | ||
$dataArr = array( 'path' => $targetPath ); | ||
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($dataArr) ); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
curl_setopt($ch, CURLOPT_FAILONERROR, true); | ||
if(!$listJson = curl_exec($ch)){ | ||
$this->errorMessage = 'ERROR getting file list: '.curl_error($ch); | ||
$this->logOrEcho($this->errorMessage); | ||
} | ||
curl_close($ch); | ||
return $listJson; | ||
} | ||
|
||
//Setters and getters | ||
public function setCollid($collid){ | ||
if(is_numeric($collid)){ | ||
$this->collid = $collid; | ||
$this->setCollMeta(); | ||
} | ||
} | ||
} |
Oops, something went wrong.