function run() { global $Templates, $DB, $Controller; $_REQUEST->setType('item', 'numeric'); $PERPAGE = 5; if ($_REQUEST['item']) { $obj = $Controller->{$_REQUEST['item']}; $content = $obj->display(false, true, true, true); } else { $QUEUE = $this->ID; $COUNT = (int) $DB->flow->count(array('queue~' => $QUEUE), 'id'); $pagination = Pagination::getRange($PERPAGE, $COUNT); $Objects = Flow::retrieve('News', $PERPAGE, false, false, false, $pagination['range']['start']); $content = ''; $first = true; foreach ($Objects as $obj) { $content .= '<li' . ($first ? '' : ' class="cols"') . '>' . $obj->display(false, $first, true) . '</li>'; $first = false; } $content = '<ul>' . $content . '</ul>' . $pagination['links']; } $r = '<h1>FlowView</h1>' . Design::row(array(Design::column('<div class="padded">' . $content . '</div>', 8, true, true, true), Design::column('Möjlighet att följa nyheterna via RSS kommer... ', 4, false, true, true)), true); $this->setContent('main', $r); $this->setContent('menu', $this->submenu()); $Templates->yweb('empty')->render(); }
function display($size = false, $first = false, $viewer = false, $fulltext = false) { global $DB, $Controller; switch ($size) { case 12: return Design::column(Design::row(array(Design::column($this->getImage(Design::getPxWidth(6), Design::getPxWidth(6), true), 6, true, false, false, false, 'aligncenter'), Design::column($this->getTitle() . $this->getDate() . $this->getText(700, false), 6))), 12, true, true, true); break; case 6: return Design::column($this->getTitle(true) . Design::row(array(Design::column($this->getImage(Design::getPxWidth(2), Design::getPxWidth(2), true) . $this->getDate(), 2, true), Design::column($this->getText(200, false), 4))), 6, $first, true); break; case 3: return Design::column($this->getTitle(true) . $this->getImage(Design::getPxWidth(3), false, true) . $this->getDate() . $this->getText(100, false), 3, $first, true); break; /* <<< New flow design >>> */ /* <<< New flow design >>> */ case 'new': default: return '<div class="articleHolder">' . $this->getTitle(false, true) . '<p class="date">' . $this->getDate(true) . '</p>' . '<div class="articleImg">' . $this->getImage(Design::getPxWidth(10), false, true) . '</div>' . '<p>' . @$this->getPreamble(300) . '</p>' . '</div>'; break; } }
function display($size = false, $first = false, $viewer = false, $fulltext = false) { global $DB, $Controller; if ($viewer) { //FIXME: Center small images when first if ($first) { return $this->getTitle(true) . $this->getDate() . '<p>' . $this->getImage(Design::getPxWidth(7)) . '</p>' . $this->getText($fulltext ? '' : 200) . '<hr />'; } return Design::column($this->getTitle(true) . $this->getDate() . $this->getText(200), 4, true) . Design::column($this->getImage(Design::getPxWidth(2)), 2, false, false, false, false, 'right') . '<hr />'; } switch ($size) { case 12: return Design::column(Design::row(array(Design::column($this->getImage(Design::getPxWidth(6), Design::getPxWidth(6), true), 6, true, false, false, false, 'aligncenter'), Design::column($this->getTitle() . $this->getDate() . $this->getText(700), 6))), 12, true, true, true); break; case 6: return Design::column($this->getTitle(true) . Design::row(array(Design::column($this->getImage(Design::getPxWidth(2), Design::getPxWidth(2), true) . $this->getDate(), 2, true), Design::column($this->getText(200), 4))), 6, $first, true); break; case 3: return Design::column($this->getTitle(true) . $this->getImage(Design::getPxWidth(3), false, true) . $this->getDate() . $this->getText(100), 3, $first, true); break; } }