Ejemplo n.º 1
0
 public static function getDashboard() {
     $items = ModelHandler::get("Users");
     $a = ViewHandler::wrapGroup("DashboardListItem", $items);
     $view = ViewHandler::getView("Users", self::$dashboardView);
     $dashboard = str_replace("<? echo \$listbody;?>", $a, $view);
     $dashboard = str_replace("<? echo \$count;?>", count($items), $dashboard);
     return $dashboard;
 }
Ejemplo n.º 2
0
 public static function getDashboard() {
     $items = ModelHandler::get("Posts");
     
     foreach ($items as $item) {
         $item->bean['content'] = strip_tags($item->bean['content']);
         $length = strlen($item->bean['content']);
         if( $length > 203 ){
             $s = substr($item->bean['content'], 0, 200);
             $s = substr($s, 0, strrpos($s, " "))."...";
             $item->bean['content'] = $s;
         }
     }
     $items = array_reverse($items);
     $a = ViewHandler::wrapGroup("DashboardListItem", $items);
     $view = ViewHandler::getView("Posts", self::$dashboardView);
     $dashboard = str_replace("<? echo \$listbody;?>", $a, $view);
     $dashboard = str_replace("<? echo \$count;?>", count($items), $dashboard);
     return $dashboard;
 }