Skip to content

Commit

Permalink
Minor bug fixes, releasing 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Dunn committed Feb 7, 2011
1 parent 2539bea commit de3edb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.markdown
@@ -1,6 +1,7 @@
# Upload Select Box Field

* Version: 1.1.1
* Version: 1.1.2
* Build Date: 2011-02-07
* Author: Nick Dunn, Brendan Abbott
* Requirements: Symphony 2.0.6+

Expand Down
8 changes: 4 additions & 4 deletions extension.driver.php
Expand Up @@ -4,21 +4,21 @@

public function about(){
return array('name' => 'Field: Uploaded File Select Box',
'version' => '1.1.1',
'release-date' => '2010-08-30',
'version' => '1.1.2',
'release-date' => '2011-02-07',
'author' => array('name' => 'Nick Dunn, Brendan Abbott',
'website' => 'http://nick-dunn.co.uk')
);
}

public function uninstall(){
$this->_Parent->Database->query("DROP TABLE `tbl_fields_uploadselectbox`");
Symphony::Database()->query("DROP TABLE `tbl_fields_uploadselectbox`");
}


public function install(){

return $this->_Parent->Database->query("CREATE TABLE `tbl_fields_uploadselectbox` (
return Symphony::Database()->query("CREATE TABLE `tbl_fields_uploadselectbox` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`allow_multiple_selection` enum('yes','no') NOT NULL default 'no',
Expand Down
8 changes: 3 additions & 5 deletions fields/field.uploadselectbox.php
Expand Up @@ -41,14 +41,12 @@ public function appendFormattedElement(&$wrapper, $data, $encode = false) {

if (!is_array($data) or empty($data)) return;

if (!is_array($data['file']) && !is_null($data['file'])) {
if (!is_array($data['file'])) {
if($data['file'] == NULL) return;
$data = array(
'file' => array($data['file'])
);
}
else {
return;
}

$item = new XMLElement($this->get('element_name'));

Expand Down Expand Up @@ -120,7 +118,7 @@ function displayPublishPanel(&$wrapper, $data=NULL, $flagWithError=NULL, $fieldn
$options = array();
$states = General::listStructure(DOCROOT . $this->get('destination'), null, false, 'asc', DOCROOT);

if (is_null($states['filelist']) || empty($status['filelist'])) $states['filelist'] = array();
if (is_null($states['filelist']) || empty($states['filelist'])) $states['filelist'] = array();

foreach($states['filelist'] as $handle => $v){
$options[] = array(General::sanitize($v), in_array($v, $data['file']), $v);
Expand Down

0 comments on commit de3edb4

Please sign in to comment.