Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-09-19 13:23:14 -04:00
commit f717efd7fb
12 changed files with 123 additions and 75 deletions

View file

@ -240,33 +240,6 @@ class Application_Model_StoredFile
}
}
/**
* Get one metadata value.
*
* @param string $p_category (MDATA_KEY_URL)
* @return string
*/
public function getMetadataValue($p_category)
{
// constant() was used because it gets quoted constant name value from
// api_client.py. This is the wrapper funtion
return $this->getDbColMetadataValue(constant($p_category));
}
/**
* Get one metadata value.
*
* @param string $p_category (url)
* @return string
*/
public function getDbColMetadataValue($p_category)
{
$propelColumn = $this->_dbMD[$p_category];
$method = "get$propelColumn";
return $this->_file->$method();
}
/**
* Get metadata as array, indexed by the column names in the database.
*
@ -423,7 +396,6 @@ SQL;
return $possible_ext;
}
// We fallback to guessing the extension from the mimetype if we
// cannot extract it from the file name
@ -1020,15 +992,18 @@ SQL;
/**
*
* Enter description here ...
* @param $dir_id - if this is not provided, it returns all files with full path constructed.
* @param $dir_id - if this is not provided, it returns all files with full
* path constructed.
*/
public static function listAllFiles($dir_id=null, $all)
{
$con = Propel::getConnection();
$sql = "SELECT filepath as fp"
." FROM CC_FILES as f"
." WHERE f.directory = :dir_id";
$sql = <<<SQL
SELECT filepath AS fp
FROM CC_FILES AS f
WHERE f.directory = :dir_id
SQL;
if (!$all) {
$sql .= " AND f.file_exists = 'TRUE'";

View file

@ -39,7 +39,7 @@
<?php if (count($watched_dirs) > 0): ?>
<?php foreach($watched_dirs as $watched_dir): ?>
<dd class="block-display selected-item">
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath"><?php echo $watched_dir->getDirectory();?></span></span>
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath" style="display:block; width:350px"><?php echo $watched_dir->getDirectory();?></span></span>
<span title="Rescan watched directory (This is useful if it is network mount and may be out of sync with Airtime)" class="ui-icon ui-icon-refresh"></span>
<span title="Remove watched directory" class="ui-icon ui-icon-close"></span>

View file

@ -1,7 +1,10 @@
<div class="wrapper">
<div id="library_content" class="lib-content tabs ui-widget ui-widget-content block-shadow alpha-block padded">
<div id="import_status" style="display:none">File import in progress...</div>
<div id="advanced_search" class="advanced_search form-horizontal"></div>
<fieldset class="toggle" id="filter_options">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend>
<div id="advanced_search" class="advanced_search form-horizontal"></div>
</fieldset>
<table id="library_display" cellpadding="0" cellspacing="0" class="datatable"></table>
</div>
<div id="show_builder" class="sb-content ui-widget ui-widget-content block-shadow omega-block padded">