Commit dd7a8fcf authored by disappearer's avatar disappearer

Smaller changes and fixes, icons and stylesheet added


git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/trunk@2460 735d13b6-9817-0410-8766-e36946ffe9aa
parent e8f58b02
22.03.2006 Michael Scharkow <michael@underused.org>
* Fixed small issues (locallang, docstrings, variable names)
* Added stylesheet file and icons in res/ (copy to fileadmin, please!)
16.03.2006 Robert Lemke <robert@typo3.org>
* Removed dummy content from renderListView_detailledExtensionRecord(). That was very confusing because in the list view the documentation link was always "not available" and downloadcounter "12333/32111" - because it was hardcoded. Please make sure to clean up before you commit.
......
......@@ -33,40 +33,42 @@
*
*
*
* 81: class tx_terfe_common
* 96: public function __construct($pObj)
* 107: public function init()
* 83: class tx_terfe_common
* 98: public function __construct($pObj)
* 109: public function init()
*
* SECTION: DATABASE RELATED FUNCTIONS
* 134: public function db_getExtensionRecord($extensionKey, $version)
* 159: public function db_prepareExtensionRecordForOutput($extensionRecord)
* 213: public function db_getExtensionDetails ($extensionKey, $version)
* 249: public function db_getExtensionKeysByOwner($owner)
* 277: public function db_getLatestVersionNumberOfExtension ($extensionKey)
* 310: protected function db_getAndUpdateExtensionDetails ($extensionKey, $version)
* 372: public function db_getFullNameByUsername ($username)
* 136: public function db_getExtensionRecord($extensionKey, $version)
* 161: public function db_prepareExtensionRecordForOutput($extensionRecord)
* 216: public function db_getExtensionDetails ($extensionKey, $version)
* 252: public function db_getExtensionKeysByOwner($owner)
* 281: public function db_getLatestVersionNumberOfExtension ($extensionKey, $ignoreReviewState=FALSE)
* 313: protected function db_getAndUpdateExtensionDetails ($extensionKey, $version)
* 375: public function db_getFullNameByUsername ($username)
*
* SECTION: RENDER FUNCTIONS
* 407: public function getRenderedDependencies($dependenciesArr)
* 488: public function getRenderedReverseDependencies ($extensionKey, $version)
* 536: public function getRenderedListOfFiles($extensionDetailsArr)
* 593: public function getRenderedFilePreview ($pathAndFileName)
* 624: public function getIcon_extension($extensionKey, $version)
* 642: public function getIcon_state ($state)
* 409: public function getTopMenu($menuItems)
* 459: public function getRenderedDependencies($dependenciesArr)
* 535: public function getRenderedReverseDependencies ($extensionKey, $version)
* 583: public function getRenderedListOfFiles($extensionDetailsArr)
* 648: public function getRenderedFilePreview ($pathAndFileName)
* 675: public function getIcon_extension($extensionKey, $version)
* 692: public function getIcon_state ($state)
*
* SECTION: FILE-RELATED FUNCTIONS
* 669: public function getExtensionVersionPathAndBaseName ($extensionKey, $version)
* 688: protected function getUnpackedT3XFile ($extensionKey, $version)
* 719: public function getExtensionVersionPathAndBaseName ($extensionKey, $version)
* 738: protected function getUnpackedT3XFile ($extensionKey, $version)
* 761: protected function transferFile ($fullPath, $visibleFilename=NULL)
*
* SECTION: EXTENSION INDEX RELATED FUNCTIONS
* 719: protected function extensionIndex_updateDB()
* 798: protected function extensionIndex_wasModified ()
* 793: protected function extensionIndex_updateDB()
* 876: protected function extensionIndex_wasModified ()
*
* SECTION: VARIOUS HELPER FUNCTIONS
* 824: public function getLL($key, $alternativeLabel='', $passThroughHtmlspecialchars=FALSE)
* 838: public function csConvHSC ($string)
* 902: public function getLL($key, $alternativeLabel='', $passThroughHtmlspecialchars=FALSE)
* 916: public function csConvHSC ($string)
*
* TOTAL FUNCTIONS: 21
* TOTAL FUNCTIONS: 23
* (This index is automatically created/updated by the extension "extdeveval")
*
*/
......@@ -289,7 +291,7 @@ class tx_terfe_common {
if (version_compare($row['version'], $latestVersion, '>')) {
$latestVersion = $row['version'];
}
}
}
return $latestVersion == '0' ? FALSE : $latestVersion;
}
......@@ -401,7 +403,7 @@ class tx_terfe_common {
* Renders the top tab menu which allows for selection of the different views.
*
* @param array $menuItems: Array of key values for the menu items
* @return string HTML output, enclosed in a DIV
* @return string HTML output, enclosed in a DIV
* @access public
*/
public function getTopMenu($menuItems) {
......@@ -432,7 +434,7 @@ class tx_terfe_common {
}
$topMenuItems .= $link;
}
$counter ++;
}
......@@ -461,7 +463,7 @@ class tx_terfe_common {
if (is_array ($dependenciesArr)) {
$alwaysAvailableExtensions = 'php,typo3,cms,lang';
$someExtensionsAreNotAvailable = FALSE;
$tableRows = array ();
$listRows = array ();
foreach ($dependenciesArr as $dependencyArr) {
if (strlen ($dependencyArr['extensionKey'])) {
......@@ -499,7 +501,7 @@ class tx_terfe_common {
// Render the depencies information:
$colorStyle = $extensionIsAvailable ? '' : 'color:red;';
if (!$extensionIsAvailable) $someExtensionsAreNotAvailable = TRUE;
$tableRows[] = '
$listRows[] = '
<li>'.$this->getLL('extension_dependencies_kind_'.$dependencyArr['kind'],'',1).' '.$this->csConvHSC ($dependencyArr['extensionKey']).' '
.$dependencyArr['versionRange'].'</li>
';
......@@ -507,14 +509,14 @@ class tx_terfe_common {
}
if ($someExtensionsAreNotAvailable) {
$tableRows[] = '
$listRows[] = '
<li style="color:red">'.$this->getLL('extension_dependencies_someextensionsarenotavailable','',1).'</li>
';
}
$output = '
<ul>
'.implode ('', $tableRows).'
'.implode ('', $listRows).'
</ul>
';
}
......@@ -542,7 +544,7 @@ class tx_terfe_common {
);
if ($res) {
$dependingExtensionKeysArr = array();
$tableRows = array();
$listRows = array();
$row = $TYPO3_DB->sql_fetch_assoc ($res);
$extensionsArr = explode (',', $row['dependingextensions']);
......@@ -555,14 +557,14 @@ class tx_terfe_common {
}
foreach ($dependingExtensionKeysArr as $key => $versionsArr) {
$tableRows[] = '<li>'.$this->csConvHSC($key).' '.implode (', ', $versionsArr).'</li>';
$listRows[] = '<li>'.$this->csConvHSC($key).' '.implode (', ', $versionsArr).'</li>';
}
if (count ($tableRows)) {
$output =
if (count ($listRows)) {
$output =
'<p>'.$this->getLL('extension_reversedependencies_intro','',1).'</p>
<ul>
'.implode ('', $tableRows).'
'.implode ('', $listRows).'
</ul>
';
}
......@@ -611,24 +613,25 @@ class tx_terfe_common {
$filePreview = '';
if (isset($this->pObj->piVars['downloadFile']) && is_array ($filesArr[urldecode($this->pObj->piVars['downloadFile'])])) {
$filename = basename(urldecode($this->pObj->piVars['downloadFile']));
$filename = basename(urldecode($this->pObj->piVars['downloadFile']));
$this->transferFile ($tempDir.basename($filesArr[urldecode($this->pObj->piVars['downloadFile'])]['tempfilename']), $filename);
unset ($this->pObj->piVars['downloadFile']);
return '';
}
if (isset($this->pObj->piVars['viewFile']) && is_array ($filesArr[urldecode($this->pObj->piVars['viewFile'])])) {
$filePreview = $this->getRenderedFilePreview ($tempDir.basename($filesArr[urldecode($this->pObj->piVars['viewFile'])]['tempfilename']));
}
$output ='
<table class="filelist">
<tr><th>Filename</th><th>Size</th><th>View</th><th>Date</th><th>Download</th></tr>
<tr><th>'.$this->getLL('extension_files_filename','',1).'
</th><th>'.$this->getLL('extension_files_filesize','',1).'
</th><th>'.$this->getLL('extension_files_preview','',1).'
</th><th>'.$this->getLL('extension_files_date','',1).'
</th><th>'.$this->getLL('extension_files_download','',1).'</th></tr>
'.implode ('', $tableRows).'
</table>
</li>
<li>
'.$filePreview;
</table>'.$filePreview;
}
return $output;
......@@ -745,19 +748,19 @@ class tx_terfe_common {
return unserialize ($dataUncompressed);
}
/**
* Transfers a file to the client browser.
* NOTE: This function must be called *before* any HTTP headers have been sent!
*
*
* @param string $fullPath: Full absolute path including filename which leads to the file to be transfered
* @param string $visibleFilename: File name which is visible for the user while downloading. If not set, the real file name will be used
* @return boolean TRUE if successful, FALSE if file did not exist. *
* @access protected
* @return boolean TRUE if successful, FALSE if file did not exist. *
* @access protected
*/
protected function transferFile ($fullPath, $visibleFilename=NULL) {
protected function transferFile ($fullPath, $visibleFilename=NULL) {
if (!@file_exists($fullPath)) return FALSE;
if (!@file_exists($fullPath)) return FALSE;
$filename = basename($fullPath);
if (!isset($visibleFilename)) $visibleFilename = $filename;
......
......@@ -53,6 +53,11 @@
<label index="extension_history"></label>
<label index="extension_download_extension"></label>
<label index="extension_files"></label>
<label index="extension_files_filename"></label>
<label index="extension_files_preview"></label>
<label index="extension_files_date"></label>
<label index="extension_files_download"></label>
<label index="extension_files_filesize"></label>
<label index="extension_filepreview"></label>
<label index="extension_documentation"></label>
</labelContext>
......@@ -108,6 +113,11 @@
<label index="extension_history">Version history</label>
<label index="extension_download_extension">Download extension</label>
<label index="extension_files">Files</label>
<label index="extension_files_filename">Filename</label>
<label index="extension_files_preview">View</label>
<label index="extension_files_date">Date</label>
<label index="extension_files_download">Download</label>
<label index="extension_files_filesize">Size</label>
<label index="extension_filepreview">Preview for file %s</label>
<label index="extension_documentation">Manual</label>
<label index="extensionfiles_downloadcompressedt3x">Download compressed extension .T3X file</label>
......
......@@ -34,21 +34,21 @@
*
*
* 72: class tx_terfe_pi1 extends tslib_pibase
* 91: protected function init($conf)
* 113: public function main($content,$conf)
* 164: protected function renderListView_new()
* 219: protected function renderListView_categories()
* 258: protected function renderListView_popular()
* 308: protected function renderListView_search()
* 336: protected function renderListView_searchResult()
* 378: protected function renderListView_fullList()
* 429: protected function renderListView_unsupported()
* 489: protected function renderSingleView_extension ($extensionKey, $version)
* 560: protected function renderSingleView_extensionInfo($extensionRecord)
* 621: protected function renderSingleView_extensionDetails ($extensionRecord)
* 673: protected function renderSingleView_feedbackForm ($extensionRecord)
* 741: protected function renderListView_detailledExtensionRecord($extensionRecord)
* 790: protected function renderListView_shortExtensionRecord($extensionRecord)
* 93: protected function init($conf)
* 115: public function main($content,$conf)
* 150: protected function renderListView_new()
* 205: protected function renderListView_categories()
* 244: protected function renderListView_popular()
* 299: protected function renderListView_search()
* 327: protected function renderListView_searchResult()
* 372: protected function renderListView_compactList($mode)
* 447: protected function renderSingleView_extension ($extensionKey, $version)
* 520: protected function renderSingleView_extensionDetails ($extensionRecord)
* 581: protected function renderSingleView_feedbackForm ($extensionRecord)
* 649: protected function renderListView_detailledExtensionRecord($extensionRecord)
* 704: protected function renderListView_shortExtensionRecord($extensionRecord)
* 738: protected function getUploadHistory($extensionKey, $lastuploaddate)
* 767: protected function renderTopMenu()
*
* TOTAL FUNCTIONS: 15
* (This index is automatically created/updated by the extension "extdeveval")
......@@ -244,7 +244,7 @@ class tx_terfe_pi1 extends tslib_pibase {
protected function renderListView_popular() {
global $TYPO3_DB;
$tableRows = array ();
$tableRows = array ();
// Set the magic "reg1" so we can clear the cache for this manual if a new one is uploaded:
if (t3lib_extMgm::isLoaded ('ter_doc')) {
......@@ -277,8 +277,8 @@ class tx_terfe_pi1 extends tslib_pibase {
if ($extensionRecord['category'] != 'doc') {
$tableRows[] = $this->renderListView_detailledExtensionRecord ($extensionRecord);
$counter ++;
}
}
}
}
}
$content.= '
......@@ -484,7 +484,7 @@ class tx_terfe_pi1 extends tslib_pibase {
$subContent = $this->renderSingleView_feedbackForm ($extensionRecord);
break;
/* case 'rating':
/* case 'rating':
require_once('class.tx_terfe_ratings.php');
$rating = new tx_terfe_ratings($extensionRecord,$this);
$subContent = $rating->renderSingleView_rating();
......@@ -510,67 +510,6 @@ class tx_terfe_pi1 extends tslib_pibase {
return $content;
}
/**
* DEPRECATED AND UNUSED
* Renders the sub view "Info" of an extension single view
*
* @param string $extensionKey: The extension key of the extension to render
* @return string HTML output
* @deprecated
*/
protected function renderSingleView_extensionInfo($extensionRecord) {
global $TSFE;
if (t3lib_extMgm::isLoaded ('ter_doc')) {
if (t3lib_extMgm::isLoaded ('ter_doc_html')) {
$terDocAPIObj = tx_terdoc_api::getInstance();
$documentationIndex = $terDocAPIObj->getRenderedTOC ($extensionRecord['extensionkey'], $extensionRecord['version']);
// Set the magic "reg1" so we can clear the cache for this manual if a new one is uploaded:
$terDocAPIObj = tx_terdoc_api::getInstance();
$TSFE->page_cache_reg1 = $terDocAPIObj->createAndGetCacheUidForExtensionVersion ($extensionRecord['extensionkey'], $extensionRecord['version']);
} else {
$documentationIndex = '<strong style="color:red;">'.$this->commonObj->getLL('general_terdochtmlnotinstalled','',1).'</strong>';
}
} else {
$documentationIndex = '<strong style="color:red;">'.$this->commonObj->getLL('general_terdocnotinstalled','',1).'</strong>';
}
$content ='
<table>
<tr>
<th class="th-sub" nowrap="nowrap">'.$this->commonObj->getLL('extension_extensionkey','',1).':</th>
<td class="td-sub"><em>'.$extensionRecord['extensionkey'].'</em></td>
<td class="td-sub" rowspan="4">
<table>
<tr><th nowrap="nowrap" class="th-sub">'.$this->commonObj->getLL('extension_state','',1).':</th><td>'.$this->commonObj->getIcon_state($extensionRecord['state_raw']).'</td></tr>
<tr><th nowrap="nowrap" class="th-sub">'.$this->commonObj->getLL('extension_version','',1).':</th><td>'.$extensionRecord['version'].'</td></tr>
<tr><th nowrap="nowrap" class="th-sub">'.$this->commonObj->getLL('extension_category','',1).':</th><td>'.$this->commonObj->getLL('extension_category_'.$extensionRecord['category']).'</td></tr>
</table>
</td>
</tr>
<tr>
<th class="th-sub" nowrap="nowrap">'.$this->commonObj->getLL('extension_description','',1).':</th>
<td class="td-sub">'.$extensionRecord['description'].'</td>
</tr>
<tr>
<th class="th-sub" nowrap="nowrap">'.$this->commonObj->getLL('extension_ownerusername','',1).':</th>
<td class="td-sub">'.$extensionRecord['ownerusernameandname'].'</td>
</tr>
<tr>
<th class="th-sub" nowrap="nowrap">'.$this->commonObj->getLL('extension_documentation','',1).':</th>
<td class="td-sub" valign="top">'.$documentationIndex.'</td>
</tr>
<tr>
<th class="th-sub" nowrap="nowrap">'.$this->commonObj->getLL('extension_uploadcomment').':</th>
<td class="td-sub" colspan=2>'.$extensionRecord['uploadcomment'].'</td>
</tr>
';
return $content;
}
/**
* Renders the details sub view of an extension single view
*
......@@ -718,7 +657,7 @@ class tx_terfe_pi1 extends tslib_pibase {
}
$extensionRecord = $this->commonObj->db_prepareExtensionRecordForOutput ($extensionRecord);
$extensionRecord['reviewstate_label'] = $extensionRecord['reviewstate_raw'] ? 'reviewed' : 'unreviewed';
$tableRows = '
<li>
<dl class="ext-header">
......@@ -789,10 +728,10 @@ class tx_terfe_pi1 extends tslib_pibase {
}
/**
* [Describe function...]
* Returns a list of recent version numbers and upload comments, max 5 items
*
* @param string $extensionKey: Extension Key
* @param int $lastuploaddate: Timestamp of last upload date
* @param int $lastuploaddate: Timestamp of last upload date
* @return mixed List of upload comments in reverse order or FALSE if an error ocurred
* @access protected
*/
......@@ -822,7 +761,7 @@ class tx_terfe_pi1 extends tslib_pibase {
/**
* Renders the top tab menu which allows for selection of the different views.
*
* @return string HTML output, enclosed in a DIV
* @return string HTML output, enclosed in a DIV
* @access protected
*/
protected function renderTopMenu() {
......@@ -856,7 +795,7 @@ class tx_terfe_pi1 extends tslib_pibase {
}
$topMenuItems .= $link;
}
$counter ++;
}
......@@ -875,4 +814,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ter_fe/
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ter_fe/pi1/class.tx_terfe_pi1.php']);
}
?>
\ No newline at end of file
?>
* {
margin:0;
padding:0;
border:0;
}
body {
position:relative;
background:#fff;
font-family:Arial,Helevetica,Geneva,"Sans Serif";
font-size:0.73em;
margin:1em;
line-height:1.2em;
}
.tx-terfe-pi1 dt {
font-weight:bold;
color:#030;
}
.tx-terfe-pi1 .hidden {
display:block;
width:1px;
height:1px;
overflow:hidden;
}
.tx-terfe-pi1 .extensions {
position:relative;
display:block;
list-style-type:none;
}
.extensions li {
position:relative;
display:block;
margin-bottom:1em;
}
.tx-terfe-pi1 .ext-header {
position:relative;
display:block;
padding:0.2em 0.5em;
background:#ffd5a6;
}
.tx-terfe-pi1 .ext-header dt {
position:absolute;
top:-100px;
left:0;
visibility:hidden;
}
.tx-terfe-pi1 .ext-header dd {
position:relative;
display:inline;
vertical-align:bottom;
}
.tx-terfe-pi1 .ext-header dd.ext-name {
position:relative;
font-weight:bold;
color:#be0027;
}
.tx-terfe-pi1 .ext-header dd.state {
position:absolute;
right:0;
top:0;
display:block;
width:109px;
height:21px;
}
.tx-terfe-pi1 .ext-header dd.state span {
position:relative;
display:block;
width:1px;
height:1px;
overflow:hidden;
line-height:30px;
}
.tx-terfe-pi1 .ext-header dd img {
position:relative;
vertical-align:bottom;
}
.tx-terfe-pi1 .ext-info {
display:block;
width:100%;
background:#CADFC2;
}
.tx-terfe-pi1 .ext-info dd.left {
position:relative;
display:block;
float:left;
width:67%;
}
.tx-terfe-pi1 .ext-info dd.left dl {
position:relative;
float:left;
width:49.99%;
min-width:50%;
background:#fff;
}
.tx-terfe-pi1 .ext-info dd.right {
position:relative;
display:block;
float:right;
width:33%;
}
.tx-terfe-pi1 .ext-info dd dl {
display:block;
border-top:1px solid #fff;
}
.tx-terfe-pi1 .ext-info dd.bottom {
display:block;
width:100%;
clear:both;
}
.tx-terfe-pi1 .ext-info dd dl dt,
.tx-terfe-pi1 .ext-info dd dl dd {
display:block;
line-height:1.2em;
padding:0.2em 0.5em;
}
.tx-terfe-pi1 .ext-info dd dl dt {
background:#ACCD9F;
}
.tx-terfe-pi1 .ext-info dd dl dd {
background:#CADFC2;
}
.tx-terfe-pi1 .ext-info dd.left dl dt {
white-space:nowrap;
border-right:1px solid #fff;
}
.tx-terfe-pi1 .ext-info dd.left dl dd {
white-space:nowrap;
border-right:1px solid #fff;
}
.tx-terfe-pi1 .ext-info dd.right dl dt {
position:relative;
white-space:nowrap;
}
.tx-terfe-pi1 .ext-info dd.right dl dd.updated {
position:relative;
white-space:nowrap;
}
.tx-terfe-pi1 .ext-info dd.right dl.changelog dd {
height:4.2em;
overflow:auto;
}
.tx-terfe-pi1 .ext-info dd.bottom dl dd {
height:3.6em;
overflow:auto;
}
.tx-terfe-pi1 .ext-header img{
height: 16px;
width: 16px;
}
.tx-terfe-pi1 .deps dd{
min-height: 8em;
}
.tx-terfe-pi1 .deps p {
white-space: normal;
}
.tx-terfe-pi1 .files {
clear:both;
margin-top:1em;
}
.tx-terfe-pi1 table.filelist {
border: 0;
border-collapse: collapse;
width: 100%;
background:#CADFC2;
text-align: center;
margin: 0.5em 0;
}
.tx-terfe-pi1 table.filelist th {
background:#ACCD9F;
}
.tx-terfe-pi1 table.filelist td.filename {
text-align: left;
}
.tx-terfe-pi1 table.ext-compactlist {
margin: 0.5em 0;
border-collapse: collapse;
border: 1px solid #ACCD9F;
}
.tx-terfe-pi1 table.ext-compactlist th {
background:#ACCD9F;
padding: 0 0.5em;
text-align: left;
}
.tx-terfe-pi1 table.ext-compactlist td {
padding: 0 0.5em;
}
.tx-terfe-pi1 table.ext-compactlist .even {
background:#CADFC2;
}
.tx-terfe-pi1 pre {
margin: 1em 0;
border: 1px solid #CADFC2;
background-color: #f9f9f9;
padding: 0.5em;
overflow:auto;
width: 99%;
}
/* State icons */
.alpha_reviewed, .alpha_unreviewed {
background:url(/fileadmin/icons/state_alpha.gif) no-repeat left;
}
.experimental_unreviewed, .experimental_reviewed {
background:url(/fileadmin/icons/state_experimental.gif) no-repeat left;
}
.beta_unreviewed {
background:url(/fileadmin/icons/state_beta.gif) no-repeat left;
}
.beta_reviewed {
background:url(/fileadmin/icons/state_beta_reviewed.gif) no-repeat left;
}
.stable_unreviewed {
background:url(/fileadmin/icons/state_stable.gif) no-repeat left;
}
.stable_reviewed {
background:url(/fileadmin/icons/state_stable_reviewed.gif) no-repeat left;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment