public function getPosition($pos) { if ($pos) { $wdb = $this->DBL; $db = DB::checkConn(); $query = 'SELECT * FROM `widgets` WHERE `published` = 1'; DB::setQuery($query); $items = DB::getList(); $html = ''; if ($items) { ob_start(); foreach ($items as $row) { $dir = PATH_ROOT . '/widgets/' . $row['w_name'] . '/' . $row['w_name'] . '.php'; if (file_exists($dir)) { ?> <div class="widget_<?php echo $pos; ?> "> <?php include $dir; ?> </div> <?php } } $html = ob_get_contents(); ob_end_clean(); } return $html; } return false; }
public function getComponents() { DB::setQuery('SELECT * FROM components '); $data = DB::getList(); if ($data) { return $data; } return array(); }
function getData() { DB::setQuery('SELECT * FROM widgets'); return DB::getList(); }