|
// +---------------------------------------------------------------------------+
// $Id$
class PublisherOutput
{
function articleOutput($oOutput)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$templ = & new HTML_Template_Flexy();
$aCurrentType = explode(' ', $oOutput->leadArticle['type']);
$oOutput->articleTmpl = 'articleView';
foreach ($aCurrentType as $key) {
$oOutput->articleTmpl .= $key;
}
$oOutput->articleTmpl .= '.html';
$templ->compile($oOutput->articleTmpl);
// if some Flexy 'elements' exist in the output object, send them as
// 2nd arg to Flexy::outputObject()
$elements = ( isset($oOutput->flexyElements) &&
is_array($oOutput->flexyElements))
? $this->flexyElements
: array();
$data = $templ->bufferedOutputObject($oOutput, $elements);
return $data;
}
/**
* Takes doc type ID from DB and converts to corresponding icon.
*
* @access public
* @param int $documentID doc type
* @return string $iconString
*/
function id2AssetIcon($documentID)
{
$theme = $_SESSION['aPrefs']['theme'];
switch ($documentID) {
case 1: $iconString = '';break;
case 2: $iconString = '
';break;
case 3: $iconString = '
';break;
case 4: $iconString = '
';break;
case 5: $iconString = '
';break;
case 6: $iconString = '
';break;
case 7: $iconString = '
';break;
default: $iconString = ' ';
}
return $iconString;
}
/**
* Maps icon HTML to corresponding position in a grid.
*
* the idea is to allow for filtering views by doc type
*
* @access public
* @param int $documentID doc type
* @return string $tdString
* @see id2AssetIcon()
*/
function outputIcon($documentID)
{
$iconString = $this->id2AssetIcon($documentID);
if ($documentID == 7) {
$pos = 1;
} else {
$pos = $documentID;
}
$tdString = '';
for ($i = 1; $i <= 6; $i++) {
$icon = ($i == $pos) ? $iconString : ' ';
$tdString .= "